Skip to content

Commit

Permalink
[libc] Fix identification of terminating character in strtoul()
Browse files Browse the repository at this point in the history
Reported-by: Elliot Huffman <ehuffman@elliot-labs.com>
Debugged-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Feb 9, 2016
1 parent 334ed1a commit ed31333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/string.c
Expand Up @@ -272,8 +272,8 @@ unsigned long strtoul ( const char *nptr, char **endptr, int base ) {
}

/* Parse digits */
while ( 1 ) {
digit = *(nptr++);
for ( ; ; nptr++ ) {
digit = *nptr;
if ( digit >= 'a' ) {
digit = ( digit - 'a' + 10 );
} else if ( digit >= 'A' ) {
Expand Down

0 comments on commit ed31333

Please sign in to comment.