mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
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:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user