From a6b39e3d1f2a93a105ea8035ccb91c044d599bf1 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Mon, 8 Jul 2024 16:41:49 +0300 Subject: [PATCH] main.c: fix range check of chance value --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 13eda0b..3ef278f 100644 --- a/src/main.c +++ b/src/main.c @@ -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; }