From 223940444cb258f90c6b7e911d1a21912ce3804e Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 16 Dec 2008 14:02:19 +0000 Subject: * Similar to apr_strtoff reset errno to zero in apr_strtoi64. Cases were observed where apr_strtoi64 returned with a previously set errno although the operation worked fine. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@727052 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'strings') diff --git a/strings/apr_strings.c b/strings/apr_strings.c index ec687913c..d20004ead 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -245,6 +245,7 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) { #ifdef APR_INT64_STRFN + errno = 0; return APR_INT64_STRFN(nptr, endptr, base); #else const char *s; @@ -253,6 +254,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) int neg, any; char c; + errno = 0; /* * Skip white space and pick up leading +/- sign if any. * If base is 0, allow 0x for hex and 0 for octal, else -- cgit v1.2.1