1
0
mirror of https://git.disroot.org/80486DX2-66/polonium.git synced 2024-11-09 15:02:20 +05:30

main.c: fix range check of chance value

This commit is contained in:
Intel A80486DX2-66 2024-07-08 16:41:49 +03:00
parent 4860ccd61e
commit a6b39e3d1f
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -115,9 +115,9 @@ static void parse_value(uint8_t destination, const char* arg) {
uintmax_t result = atoumax_base10(arg);
switch (destination) {
case ARG_DEST_POSSIBILITY:
if (result == 0 || result > UINT8_MAX) {
FATAL_ERROR("Chance value should be in range [1..%" PRIu8 "]",
UINT8_MAX);
if (result == 0 || result > UINT16_MAX) {
FATAL_ERROR("Chance value should be in range [1..%" PRIu16 "]",
UINT16_MAX);
return;
}