diff --git a/CHANGES b/CHANGES index 004e8956a70..340af0f17cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.3.4 + *) Reset errno to zero in apr_strtoi64 to prevent returning an errno not + equal zero in cases where the operation worked fine. [Ruediger Pluem] + *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. [Justin Erenkrantz] diff --git a/strings/apr_strings.c b/strings/apr_strings.c index ec687913c53..d20004eadae 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