david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Added isspace() and made strtoul() accept whitespace, as per POSIX.

This commit is contained in:
Michael Brown 2007-01-12 19:11:28 +00:00
parent 83b7933f8a
commit ca3db0bf11
1 changed files with 17 additions and 0 deletions

View File

@ -152,10 +152,27 @@ int inet_aton ( const char *cp, struct in_addr *inp ) {
return 0;
}
int isspace ( int c ) {
switch ( c ) {
case ' ':
case '\f':
case '\n':
case '\r':
case '\t':
case '\v':
return 1;
default:
return 0;
}
}
unsigned long strtoul ( const char *p, char **endp, int base ) {
unsigned long ret = 0;
unsigned int charval;
while ( isspace ( *p ) )
p++;
if ( base == 0 ) {
base = 10;
if ( *p == '0' ) {