Explorar el Código

LibC: Use the templated type consistently in strtol_impl<T>

Andreas Kling hace 5 años
padre
commit
545e2ba065
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      Libraries/LibC/stdlib.cpp

+ 2 - 2
Libraries/LibC/stdlib.cpp

@@ -81,10 +81,10 @@ static inline T strtol_impl(const char* nptr, char** endptr, int base)
         }
     }
 
-    long cutoff_point = is_negative ? (min_value / base) : (max_value / base);
+    T cutoff_point = is_negative ? (min_value / base) : (max_value / base);
     int max_valid_digit_at_cutoff_point = is_negative ? (min_value % base) : (max_value % base);
 
-    long num = 0;
+    T num = 0;
 
     bool has_overflowed = false;
     unsigned digits_consumed = 0;