]> git.eshelyaron.com Git - emacs.git/commitdiff
Restrict loop variable scope in `xpm_str_to_color_key`
authorStefan Kangas <stefankangas@gmail.com>
Fri, 12 Jul 2024 00:16:47 +0000 (02:16 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 17 Jul 2024 21:48:12 +0000 (23:48 +0200)
* src/image.c (xpm_str_to_color_key): Restrict scope of
loop variable.

(cherry picked from commit 72ba45e2749df8561fe93bafdefbdc8eca56571f)

src/image.c

index 3d761bd48bedf59b79c59b28600ec7a60ea0420c..b77c12b4cbc5a317d10a19162933d9ed06fa926e 100644 (file)
@@ -6249,9 +6249,7 @@ static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
 static int
 xpm_str_to_color_key (const char *s)
 {
-  int i;
-
-  for (i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
+  for (int i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
     if (strcmp (xpm_color_key_strings[i], s) == 0)
       return i;
   return -1;