diff options
Diffstat (limited to 'base/mac/mac_util.mm')
-rw-r--r-- | base/mac/mac_util.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm index 66fbf11..2ba1a30 100644 --- a/base/mac/mac_util.mm +++ b/base/mac/mac_util.mm @@ -14,6 +14,7 @@ #include "base/mac/scoped_cftyperef.h" #include "base/memory/scoped_nsobject.h" #include "base/string_number_conversions.h" +#include "base/string_piece.h" #include "base/sys_string_conversions.h" namespace base { @@ -521,7 +522,9 @@ int DarwinMajorVersionInternal() { int darwin_major_version = 0; char* dot = strchr(uname_info.release, '.'); if (dot) { - if (!base::StringToInt(uname_info.release, dot, &darwin_major_version)) { + if (!base::StringToInt(base::StringPiece(uname_info.release, + dot - uname_info.release), + &darwin_major_version)) { dot = NULL; } } |