Sfoglia il codice sorgente

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

Andreas Kling 5 anni fa
parent
commit
545e2ba065
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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;