mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
- Add NULL checks to _atoi64, _wtol, and _wtoi64.
- Since atoi, atol, and _wtoi should check for NULL (_tcstol doesn't) but should not check for overflow (_tcstol does), make them call _ttoi64 instead of _tcstol. svn path=/trunk/; revision=35078
This commit is contained in:
@@ -8,5 +8,5 @@
|
||||
int
|
||||
_ttoi(const _TCHAR *str)
|
||||
{
|
||||
return (int)_tcstol(str, 0, 10);
|
||||
return (int)_ttoi64(str);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ _atoi64(const char *nptr)
|
||||
__int64 acc = 0;
|
||||
int neg = 0;
|
||||
|
||||
if (nptr == NULL)
|
||||
return 0;
|
||||
|
||||
while(isspace((int)*s))
|
||||
s++;
|
||||
if (*s == '-')
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
long
|
||||
_ttol(const _TCHAR *str)
|
||||
{
|
||||
return _tcstol(str, 0, 10);
|
||||
return (long)_ttoi64(str);
|
||||
}
|
||||
|
||||
int _atoldbl(long double *value, const char *str)
|
||||
|
||||
@@ -20,6 +20,9 @@ _wtoi64 (const wchar_t *nptr)
|
||||
__int64 value;
|
||||
int sign;
|
||||
|
||||
if (nptr == NULL)
|
||||
return 0;
|
||||
|
||||
while (iswctype((int)*nptr, _SPACE))
|
||||
++nptr;
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ _wtol(const wchar_t *str)
|
||||
unsigned long RunningTotal = 0;
|
||||
char bMinus = 0;
|
||||
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
while (iswctype(*str, _SPACE) ) {
|
||||
str++;
|
||||
} /* while */
|
||||
|
||||
Reference in New Issue
Block a user