aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-03-03 11:11:16 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-03-03 11:11:16 +0100
commit609779086301a600f4282a629d586bba6b6a485c (patch)
tree0f29dd18b05d3c75cb9b5f6f94d7b3807aeea087 /src/libutil
parent885d709393caabd346299c6d6ec8ea57b8a11628 (diff)
Fix segfault in headerCallback()
https://hydra.nixos.org/build/168594664
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 229bebbe6..b833038a9 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -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);
}