Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09c8decc authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

Merge "Add 0X as a valid hex prefix for parseint" am: 392a2c8f am: 11373394 am: 92b17274

am: 35146c46

Change-Id: I8504fe6492f31ff0b7f72fb1e672df6aae75eb54
parents f14fdbea 35146c46
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ namespace base {
template <typename T>
bool ParseUint(const char* s, T* out,
               T max = std::numeric_limits<T>::max()) {
  int base = (s[0] == '0' && s[1] == 'x') ? 16 : 10;
  int base = (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10;
  errno = 0;
  char* end;
  unsigned long long int result = strtoull(s, &end, base);
@@ -53,7 +53,7 @@ template <typename T>
bool ParseInt(const char* s, T* out,
              T min = std::numeric_limits<T>::min(),
              T max = std::numeric_limits<T>::max()) {
  int base = (s[0] == '0' && s[1] == 'x') ? 16 : 10;
  int base = (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10;
  errno = 0;
  char* end;
  long long int result = strtoll(s, &end, base);