summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpluem <rpluem@13f79535-47bb-0310-9956-ffa450edef68>2008-12-18 01:01:54 +0000
committerrpluem <rpluem@13f79535-47bb-0310-9956-ffa450edef68>2008-12-18 01:01:54 +0000
commit780f62cfbc3e1ae38fe865569f40a6ab58acdf4e (patch)
tree12d75fbeac71e3b4925eac552a25dded35ac3d20
parent5a2db2dfba67e19b54089f38e755397c79509646 (diff)
downloadlibapr-780f62cfbc3e1ae38fe865569f40a6ab58acdf4e.tar.gz
Merge r727052 from trunk:
* 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. Submitted by: rpluem Reviewed by: rpluem git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x@727605 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--strings/apr_strings.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 004e8956a..340af0f17 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 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