Use MRB_INT_MAX instead of INT_MAX according to variable type.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-09-07 15:58:22 +09:00
parent ed97c1779e
commit 55a2ff5faf
+1 -1
View File
@@ -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)) {
return NULL;
}
if (INT_MAX - (*p - '0') < next_n) {
if (MRB_INT_MAX - (*p - '0') < next_n) {
return NULL;
}
next_n += *p - '0';