Skip to content

Commit

Permalink
Merge r727052 from trunk:
Browse files Browse the repository at this point in the history
* 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: https://svn.apache.org/repos/asf/apr/apr/branches/1.3.x@727605 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
rpluem committed Dec 18, 2008
1 parent 51be398 commit 9de5684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 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]

Expand Down
2 changes: 2 additions & 0 deletions strings/apr_strings.c
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 9de5684

Please sign in to comment.