From: Ben Pfaff Date: Mon, 27 Feb 2023 04:26:44 +0000 (-0800) Subject: dictionary: Avoid name shadowing in dict_clone(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fe157aa60e9eff822de37cfe1c181a942deda70;p=pspp dictionary: Avoid name shadowing in dict_clone(). In this case, it wasn't a bug, but it was confusing. --- 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; }