Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

rename _errno #60

Merged
merged 1 commit into from

2 participants

@ghazel

On WIN32, _errno is already used as a function identifier. This patch just renames it.

@hawicz hawicz merged commit 3ae296f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 4, 2013
  1. @ghazel

    rename _errno

    ghazel authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 json_util.c
View
10 json_util.c
@@ -147,14 +147,14 @@ int json_parse_int64(const char *buf, int64_t *retval)
int64_t num64;
const char *buf_skip_space;
int orig_has_neg;
- int _errno;
+ int saved_errno;
errno = 0; // sscanf won't always set errno, so initialize
if (sscanf(buf, "%" SCNd64, &num64) != 1)
{
MC_DEBUG("Failed to parse, sscanf != 1\n");
return 1;
}
- _errno = errno;
+ saved_errno = errno;
buf_skip_space = buf;
orig_has_neg = 0;
// Skip leading spaces
@@ -171,7 +171,7 @@ int json_parse_int64(const char *buf, int64_t *retval)
if (buf_skip_space[0] == '0' && buf_skip_space[1] == '\0')
orig_has_neg = 0; // "-0" is the same as just plain "0"
- if (_errno != ERANGE)
+ if (saved_errno != ERANGE)
{
char buf_cmp[100];
char *buf_cmp_start = buf_cmp;
@@ -199,10 +199,10 @@ int json_parse_int64(const char *buf, int64_t *retval)
)
)
{
- _errno = ERANGE;
+ saved_errno = ERANGE;
}
}
- if (_errno == ERANGE)
+ if (saved_errno == ERANGE)
{
if (orig_has_neg)
num64 = INT64_MIN;
Something went wrong with that request. Please try again.