- 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:
Jeffrey Morlan 2008-08-03 18:35:54 +00:00
parent ec62b2846e
commit 4129e7e645
5 changed files with 11 additions and 2 deletions

View file

@ -8,5 +8,5 @@
int
_ttoi(const _TCHAR *str)
{
return (int)_tcstol(str, 0, 10);
return (int)_ttoi64(str);
}

View file

@ -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 == '-')

View file

@ -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)

View file

@ -20,6 +20,9 @@ _wtoi64 (const wchar_t *nptr)
__int64 value;
int sign;
if (nptr == NULL)
return 0;
while (iswctype((int)*nptr, _SPACE))
++nptr;

View file

@ -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 */