diff --git a/src/string_utils.cc b/src/string_utils.cc index 742a3f19..0a420fec 100644 --- a/src/string_utils.cc +++ b/src/string_utils.cc @@ -100,6 +100,8 @@ Optional str_to_int_ifp(StringView str) bool negative = not str.empty() and str[0] == '-'; if (negative) str = str.substr(1_byte); + if (str.empty()) + return {}; unsigned int res = 0; for (auto c : str)