From 5e1cd6178a327527bc7901b17714257b4e6d871f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 12 Jul 2024 02:16:47 +0200 Subject: [PATCH] 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) --- src/image.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; -- 2.39.5