summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtol.c
diff options
context:
space:
mode:
authorpat <>2005-03-30 18:51:49 +0000
committerpat <>2005-03-30 18:51:49 +0000
commit894b6ab0099e7d9ca2ad9acb75246cd0a4542167 (patch)
treef9fb8e9324f6cbdc10d72cab8b889d470252465a /src/lib/libc/stdlib/strtol.c
parent162f8b042bf31ab94714a6f194e9836c08c085f5 (diff)
downloadopenbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.gz
openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.tar.bz2
openbsd-894b6ab0099e7d9ca2ad9acb75246cd0a4542167.zip
ansi + de-register
ok otto deraadt
Diffstat (limited to 'src/lib/libc/stdlib/strtol.c')
-rw-r--r--src/lib/libc/stdlib/strtol.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/libc/stdlib/strtol.c b/src/lib/libc/stdlib/strtol.c
index 1c39720794..9692bb6b07 100644
--- a/src/lib/libc/stdlib/strtol.c
+++ b/src/lib/libc/stdlib/strtol.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strtol.c,v 1.5 2003/06/02 20:18:38 millert Exp $"; 31static char *rcsid = "$OpenBSD: strtol.c,v 1.6 2005/03/30 18:51:49 pat Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <ctype.h> 34#include <ctype.h>
@@ -44,15 +44,12 @@ static char *rcsid = "$OpenBSD: strtol.c,v 1.5 2003/06/02 20:18:38 millert Exp $
44 * alphabets and digits are each contiguous. 44 * alphabets and digits are each contiguous.
45 */ 45 */
46long 46long
47strtol(nptr, endptr, base) 47strtol(const char *nptr, char **endptr, int base)
48 const char *nptr;
49 char **endptr;
50 register int base;
51{ 48{
52 register const char *s; 49 const char *s;
53 register long acc, cutoff; 50 long acc, cutoff;
54 register int c; 51 int c;
55 register int neg, any, cutlim; 52 int neg, any, cutlim;
56 53
57 /* 54 /*
58 * Skip white space and pick up leading +/- sign if any. 55 * Skip white space and pick up leading +/- sign if any.