parts: fix bug with INT_MIN in numeral object

Use 64-bit integer to avoid overflow when creating numeral for INT_MIN.
This commit is contained in:
Nunuhara Cabbage
2022-06-25 09:22:11 -07:00
parent 841947d544
commit 3a40542aab
+1 -1
View File
@@ -577,7 +577,7 @@ static bool parts_numeral_update(struct parts *parts, struct parts_numeral *num)
// XXX: don't generate texture if number hasn't been set yet
if (!num->have_num)
return true;
int n = num->num;
int_least64_t n = num->num;
bool negative = n < 0;
if (negative)
n *= -1;