1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

Shut up a gcc warning

This commit is contained in:
Eelco Dolstra 2023-01-26 16:43:06 +01:00
parent f4f0f8ae3f
commit 37b4a9ec66

View file

@ -40,6 +40,7 @@ SourcePath EvalState::decodePath(std::string_view s, PosIdx pos)
try { try {
auto slash = s.find('/'); auto slash = s.find('/');
if (slash > 20) throw std::invalid_argument("");
size_t number = std::stoi(std::string(s.substr(0, slash)), nullptr, 16); size_t number = std::stoi(std::string(s.substr(0, slash)), nullptr, 16);
s = slash == s.npos ? "" : s.substr(slash); s = slash == s.npos ? "" : s.substr(slash);