From 9c60701e4f39d7039da73e7dd5a36f5edade308a Mon Sep 17 00:00:00 2001 From: ocean Date: Sat, 22 Oct 2005 01:28:00 +0000 Subject: * missing.h, missing/*.c: SUSv3 compatible strcasecmp and strncasecmp, ANSI compatible strtol and strtoul, and ANSI styled other functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/strtol.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'missing/strtol.c') diff --git a/missing/strtol.c b/missing/strtol.c index e94aa54ca0..da6636f316 100644 --- a/missing/strtol.c +++ b/missing/strtol.c @@ -3,13 +3,10 @@ #include long -strtol(nptr, endptr, base) - char *nptr; - char **endptr; - int base; +strtol(const char *nptr, char **endptr, int base) { long result; - char *p = nptr; + const char *p = nptr; while (isspace(*p)) { p++; @@ -23,7 +20,7 @@ strtol(nptr, endptr, base) result = strtoul(p, endptr, base); } if (endptr != 0 && *endptr == p) { - *endptr = nptr; + *endptr = (char *)nptr; } return result; } -- cgit v1.2.3