| Index: third_party/crashpad/crashpad/util/stdlib/string_number_conversion.cc
|
| diff --git a/third_party/crashpad/crashpad/util/stdlib/string_number_conversion.cc b/third_party/crashpad/crashpad/util/stdlib/string_number_conversion.cc
|
| index 8ab949efeaf85404b931bc38a7e9dccd9f4ba67e..28f6ea11b60bbc7e056bce9aa1c11a465301a0a0 100644
|
| --- a/third_party/crashpad/crashpad/util/stdlib/string_number_conversion.cc
|
| +++ b/third_party/crashpad/crashpad/util/stdlib/string_number_conversion.cc
|
| @@ -16,6 +16,7 @@
|
|
|
| #include <ctype.h>
|
| #include <errno.h>
|
| +#include <inttypes.h>
|
| #include <stdlib.h>
|
| #include <string.h>
|
|
|
| @@ -102,12 +103,24 @@ struct StringToUnsignedIntTraits
|
| : public StringToUnsignedIntegerTraits<unsigned int, unsigned long> {
|
| static LongType Convert(const char* str, char** end, int base) {
|
| if (str[0] == '-') {
|
| + *end = const_cast<char*>(str);
|
| return 0;
|
| }
|
| return strtoul(str, end, base);
|
| }
|
| };
|
|
|
| +struct StringToUnsignedInt64Traits
|
| + : public StringToUnsignedIntegerTraits<uint64_t, uint64_t> {
|
| + static LongType Convert(const char* str, char** end, int base) {
|
| + if (str[0] == '-') {
|
| + *end = const_cast<char*>(str);
|
| + return 0;
|
| + }
|
| + return strtoull(str, end, base);
|
| + }
|
| +};
|
| +
|
| template <typename Traits>
|
| bool StringToIntegerInternal(const base::StringPiece& string,
|
| typename Traits::IntType* number) {
|
| @@ -153,4 +166,8 @@ bool StringToNumber(const base::StringPiece& string, unsigned int* number) {
|
| return StringToIntegerInternal<StringToUnsignedIntTraits>(string, number);
|
| }
|
|
|
| +bool StringToNumber(const base::StringPiece& string, uint64_t* number) {
|
| + return StringToIntegerInternal<StringToUnsignedInt64Traits>(string, number);
|
| +}
|
| +
|
| } // namespace crashpad
|
|
|