From dd45af75d87c680c7de07d591095751a0d75e49a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 6 Feb 2021 20:13:50 -0800 Subject: [PATCH] spv-light-decoder: Use unsigned int, not int, for %x with sscanf(). Found by cppcheck. Reported by John Darrington. --- src/output/spv/spv-light-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output/spv/spv-light-decoder.c b/src/output/spv/spv-light-decoder.c index 58b5ddbe02..fb0dd18d6a 100644 --- a/src/output/spv/spv-light-decoder.c +++ b/src/output/spv/spv-light-decoder.c @@ -96,7 +96,7 @@ static char * WARN_UNUSED_RESULT decode_spvlb_color_string (const char *s, uint8_t def, struct cell_color *colorp) { - int r, g, b; + unsigned int r, g, b; if (!*s) r = g = b = def; else if (sscanf (s, "#%2x%2x%2x", &r, &g, &b) != 3) -- 2.30.2