From: Stefan Kangas Date: Fri, 12 Jul 2024 00:16:47 +0000 (+0200) Subject: Restrict loop variable scope in `xpm_str_to_color_key` X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e1cd6178a327527bc7901b17714257b4e6d871f;p=emacs.git Restrict loop variable scope in `xpm_str_to_color_key` * src/image.c (xpm_str_to_color_key): Restrict scope of loop variable. (cherry picked from commit 72ba45e2749df8561fe93bafdefbdc8eca56571f) --- diff --git a/src/image.c b/src/image.c index 3d761bd48be..b77c12b4cbc 100644 --- a/src/image.c +++ b/src/image.c @@ -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;