diff options
author | 2013-04-17 17:40:35 +0000 | |
---|---|---|
committer | 2013-04-17 17:40:35 +0000 | |
commit | 928cef96820a77291fe483e919fcbcc7abcb3319 (patch) | |
tree | 6d2f17e88a0caab51454d7a136558371549f03ca /lib/libc/stdlib/strtol.c | |
parent | silence some warnings by adding prototypes, casts, and headers as (diff) | |
download | wireguard-openbsd-928cef96820a77291fe483e919fcbcc7abcb3319.tar.xz wireguard-openbsd-928cef96820a77291fe483e919fcbcc7abcb3319.zip |
add some prototypes, casts, includes, parenthesis, and whatnot to
silence some warnings.
Diffstat (limited to 'lib/libc/stdlib/strtol.c')
-rw-r--r-- | lib/libc/stdlib/strtol.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c index 745bc4c2ce2..dc2cf8871cc 100644 --- a/lib/libc/stdlib/strtol.c +++ b/lib/libc/stdlib/strtol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strtol.c,v 1.8 2012/11/18 04:13:39 jsing Exp $ */ +/* $OpenBSD: strtol.c,v 1.9 2013/04/17 17:40:35 tedu Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -54,7 +54,7 @@ strtol(const char *nptr, char **endptr, int base) */ if (base != 0 && (base < 2 || base > 36)) { if (endptr != 0) - *endptr = nptr; + *endptr = (char *)nptr; errno = EINVAL; return 0; } @@ -124,7 +124,7 @@ strtol(const char *nptr, char **endptr, int base) if (any < 0) continue; if (neg) { - if (acc < cutoff || acc == cutoff && c > cutlim) { + if (acc < cutoff || (acc == cutoff && c > cutlim)) { any = -1; acc = LONG_MIN; errno = ERANGE; @@ -134,7 +134,7 @@ strtol(const char *nptr, char **endptr, int base) acc -= c; } } else { - if (acc > cutoff || acc == cutoff && c > cutlim) { + if (acc > cutoff || (acc == cutoff && c > cutlim)) { any = -1; acc = LONG_MAX; errno = ERANGE; |