reactos/reactos/lib/string/atoi64.c
Alex Ionescu 48fe1fb84b Share more duplicated functions
svn path=/trunk/; revision=17734
2005-09-08 05:03:34 +00:00

36 lines
518 B
C

#include <string.h>
#include <ctype.h>
/*
* @implemented
*/
__int64
_atoi64 (const char *nptr)
{
int c;
__int64 value;
int sign;
while (isspace((int)*nptr))
++nptr;
c = (int)*nptr++;
sign = c;
if (c == '-' || c == '+')
c = (int)*nptr++;
value = 0;
while (isdigit(c))
{
value = 10 * value + (c - '0');
c = (int)*nptr++;
}
if (sign == '-')
return -value;
else
return value;
}
/* EOF */