mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
readint.c (mrb_read_int): narrow scope of a local variable
This commit is contained in:
+1
-2
@@ -12,10 +12,9 @@ MRB_API mrb_bool
|
||||
mrb_read_int(const char *p, const char *e, char **endp, mrb_int *np)
|
||||
{
|
||||
mrb_int n = 0;
|
||||
int ch;
|
||||
|
||||
while ((e == NULL || p < e) && ISDIGIT(*p)) {
|
||||
ch = *p - '0';
|
||||
int ch = *p - '0';
|
||||
if (mrb_int_mul_overflow(n, 10, &n) ||
|
||||
mrb_int_add_overflow(n, ch, &n)) {
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user