Skip to content

Commit

Permalink
Avoid shadowing global variable. Fixes #89
Browse files Browse the repository at this point in the history
  • Loading branch information
stig committed Jul 28, 2011
1 parent 4be3143 commit a4a7f03
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Classes/SBJsonTokeniser.m
Expand Up @@ -322,26 +322,26 @@ - (sbjson_token_t)getNumberToken:(NSObject**)token {
return sbjson_token_eof;
}

short exp = 0;
short exp_length = 0;
short explicit_exponent = 0;
short explicit_exponent_length = 0;
while ([digits characterIsMember:ch]) {
exp *= 10;
exp += (ch - '0');
exp_length++;
explicit_exponent *= 10;
explicit_exponent += (ch - '0');
explicit_exponent_length++;

if (![_stream getNextUnichar:&ch])
return sbjson_token_eof;
}

if (exp_length == 0) {
if (explicit_exponent_length == 0) {
self.error = @"No digits in exponent";
return sbjson_token_error;
}

if (expIsNegative)
exponent -= exp;
exponent -= explicit_exponent;
else
exponent += exp;
exponent += explicit_exponent;
}

if (!mantissa_length && isNegative) {
Expand Down

0 comments on commit a4a7f03

Please sign in to comment.