From 6fe157aa60e9eff822de37cfe1c181a942deda70 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 26 Feb 2023 20:26:44 -0800 Subject: [PATCH] dictionary: Avoid name shadowing in dict_clone(). In this case, it wasn't a bug, but it was confusing. --- src/data/dictionary.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 57fe2c08ef..5563897014 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -309,10 +309,9 @@ dict_clone (const struct dictionary *s) { struct variable *sv = s->vars[i].var; struct variable *dv = dict_clone_var_assert (d, sv); - size_t i; - for (i = 0; i < var_get_n_short_names (sv); i++) - var_set_short_name (dv, i, var_get_short_name (sv, i)); + for (size_t j = 0; j < var_get_n_short_names (sv); j++) + var_set_short_name (dv, j, var_get_short_name (sv, j)); var_get_vardict (dv)->case_index = var_get_vardict (sv)->case_index; } -- 2.30.2