diff options
Diffstat (limited to 'src/lib/libc/stdlib/strtol.c')
| -rw-r--r-- | src/lib/libc/stdlib/strtol.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/strtol.c b/src/lib/libc/stdlib/strtol.c index dc2cf8871c..86cec35086 100644 --- a/src/lib/libc/stdlib/strtol.c +++ b/src/lib/libc/stdlib/strtol.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* $OpenBSD: strtol.c,v 1.9 2013/04/17 17:40:35 tedu Exp $ */ | 1 | /* $OpenBSD: strtol.c,v 1.10 2014/09/13 20:10:12 schwarze Exp $ */ |
| 2 | /*- | 2 | /* |
| 3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
| 4 | * All rights reserved. | 4 | * All rights reserved. |
| 5 | * | 5 | * |
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <limits.h> | 33 | #include <limits.h> |
| 34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
| 35 | 35 | ||
| 36 | |||
| 37 | /* | 36 | /* |
| 38 | * Convert a string to a long integer. | 37 | * Convert a string to a long integer. |
| 39 | * | 38 | * |
| @@ -52,7 +51,7 @@ strtol(const char *nptr, char **endptr, int base) | |||
| 52 | * Ensure that base is between 2 and 36 inclusive, or the special | 51 | * Ensure that base is between 2 and 36 inclusive, or the special |
| 53 | * value of 0. | 52 | * value of 0. |
| 54 | */ | 53 | */ |
| 55 | if (base != 0 && (base < 2 || base > 36)) { | 54 | if (base < 0 || base == 1 || base > 36) { |
| 56 | if (endptr != 0) | 55 | if (endptr != 0) |
| 57 | *endptr = (char *)nptr; | 56 | *endptr = (char *)nptr; |
| 58 | errno = EINVAL; | 57 | errno = EINVAL; |
