summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2013-01-09 15:26:42 -0800
committerEric Haszlakiewicz <erh+git@nimenees.com>2013-01-09 15:26:42 -0800
commit3ae296f6946100e533a4358629aa34e74501a039 (patch)
treedeb9c63c0f5dccdb4bac4e3b8ac99429a8bf8930
parent85da28c53420659620bad73943436bb5115c2a4a (diff)
parent77d0493b7062ac0c811a92dea98cf094737e3957 (diff)
downloadjson-c-3ae296f6946100e533a4358629aa34e74501a039.tar.gz
Merge pull request #60 from ghazel/master
rename _errno
-rw-r--r--json_util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/json_util.c b/json_util.c
index 79ae5c7..4030cbe 100644
--- a/json_util.c
+++ b/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;