spv-light-decoder: Use unsigned int, not int, for %x with sscanf().
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 7 Feb 2021 04:13:50 +0000 (20:13 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 7 Feb 2021 04:13:50 +0000 (20:13 -0800)
Found by cppcheck.
Reported by John Darrington.

src/output/spv/spv-light-decoder.c

index 58b5ddbe0294019cf9988c9ec1c1fb402fb12fdb..fb0dd18d6aba1e8b8fc8db04641f5e29a8e5d615 100644 (file)
@@ -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)