Browse Source

Making it clear that safe_strtou64 kind of string to int conversion apis fail when non decimal chars are present. (#2744)

pull/2746/head
penmetsaa 4 years ago
committed by GitHub
parent
commit
d9d5abc6b6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      cpp/src/phonenumbers/stringutil.cc
  2. +1
    -1
      cpp/test/phonenumbers/stringutil_test.cc

+ 1
- 1
cpp/src/phonenumbers/stringutil.cc View File

@ -293,4 +293,4 @@ void StrAppend(string* dest, const StringHolder& s1, const StringHolder& s2,
}
} // namespace phonenumbers
} // namespace i18n
} // namespace i18n

+ 1
- 1
cpp/test/phonenumbers/stringutil_test.cc View File

@ -135,7 +135,7 @@ TEST(StringUtilTest, safe_strtou64) {
safe_strtou64("16", &n);
EXPECT_EQ(16U, n);
safe_strtou64("18446744073709551615UL", &n);
safe_strtou64("18446744073709551615", &n);
EXPECT_EQ(18446744073709551615ULL, n);
}


Loading…
Cancel
Save