Use `MRB_INT_MAX` instead of `INT_MAX` according to variable type.

parent ed97c177
...@@ -224,7 +224,7 @@ get_num(mrb_state *mrb, const char *p, const char *end, mrb_int *valp) ...@@ -224,7 +224,7 @@ get_num(mrb_state *mrb, const char *p, const char *end, mrb_int *valp)
if (mrb_int_mul_overflow(10, next_n, &next_n)) { if (mrb_int_mul_overflow(10, next_n, &next_n)) {
return NULL; return NULL;
} }
if (INT_MAX - (*p - '0') < next_n) { if (MRB_INT_MAX - (*p - '0') < next_n) {
return NULL; return NULL;
} }
next_n += *p - '0'; next_n += *p - '0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment