1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Fix segfault in headerCallback()

https://hydra.nixos.org/build/168594664
This commit is contained in:
Eelco Dolstra 2022-03-03 11:11:16 +01:00
parent 885d709393
commit 6097790863
4 changed files with 7 additions and 7 deletions

View file

@ -1263,9 +1263,9 @@ std::string chomp(std::string_view s)
std::string trim(std::string_view s, std::string_view whitespace)
{
auto i = s.find_first_not_of(whitespace);
if (i == std::string_view::npos) return "";
if (i == s.npos) return "";
auto j = s.find_last_not_of(whitespace);
return std::string(s, i, j == std::string::npos ? j : j - i + 1);
return std::string(s, i, j == s.npos ? j : j - i + 1);
}