Skip to content

Commit a4a7f03

Browse files
committed
Avoid shadowing global variable. Fixes SBJson#89
1 parent 4be3143 commit a4a7f03

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Classes/SBJsonTokeniser.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,26 +322,26 @@ - (sbjson_token_t)getNumberToken:(NSObject**)token {
322322
return sbjson_token_eof;
323323
}
324324

325-
short exp = 0;
326-
short exp_length = 0;
325+
short explicit_exponent = 0;
326+
short explicit_exponent_length = 0;
327327
while ([digits characterIsMember:ch]) {
328-
exp *= 10;
329-
exp += (ch - '0');
330-
exp_length++;
328+
explicit_exponent *= 10;
329+
explicit_exponent += (ch - '0');
330+
explicit_exponent_length++;
331331

332332
if (![_stream getNextUnichar:&ch])
333333
return sbjson_token_eof;
334334
}
335335

336-
if (exp_length == 0) {
336+
if (explicit_exponent_length == 0) {
337337
self.error = @"No digits in exponent";
338338
return sbjson_token_error;
339339
}
340340

341341
if (expIsNegative)
342-
exponent -= exp;
342+
exponent -= explicit_exponent;
343343
else
344-
exponent += exp;
344+
exponent += explicit_exponent;
345345
}
346346

347347
if (!mantissa_length && isNegative) {

0 commit comments

Comments
 (0)