diff options
Diffstat (limited to 'lib/libc/stdlib/strtoul.c')
| -rw-r--r-- | lib/libc/stdlib/strtoul.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c index 2146a98b8ac0..a8e37364101b 100644 --- a/lib/libc/stdlib/strtoul.c +++ b/lib/libc/stdlib/strtoul.c @@ -73,7 +73,11 @@ strtoul(const char * __restrict nptr, char ** __restrict endptr, int base)  			c = *s++;  	}  	if ((base == 0 || base == 16) && -	    c == '0' && (*s == 'x' || *s == 'X')) { +	    c == '0' && (*s == 'x' || *s == 'X') && +	    ((s[1] >= 'a' && s[1] <= 'f') || +	     (s[1] >= 'A' && s[1] <= 'F') || +	     (s[1] >= '0' && s[1] <= '9')) +	   ) {  		c = s[1];  		s += 2;  		base = 16;  | 
