From 335a47f70aa3e1a6bfd29e83e58f5daca1195067 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 28 Dec 2015 12:47:52 +0100 Subject: [PATCH] frontend/device.c, com_alter_common(), #2/4 shrink scope of locals --- src/frontend/device.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontend/device.c b/src/frontend/device.c index 5498d149b..0aafbed47 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1122,12 +1122,9 @@ com_alter_common(wordlist *wl, int do_model) struct pnode *names; /* DIE 2009_02_06 */ - char *argument; - char **arglist; int step = 0, n, wlen, maxelem = 3; wordlist *wl2 = NULL, *wlin, *rhs; bool eqfound = FALSE; - char *eqptr = NULL; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -1151,9 +1148,9 @@ com_alter_common(wordlist *wl, int do_model) */ wlin = wl; while (wl) { - argument = wl->wl_word; + char *argument = wl->wl_word; /* searching for '=' ... */ - eqptr = strchr(argument, '='); + char *eqptr = strchr(argument, '='); /* argument may be '=', then do nothing or =token @@ -1168,6 +1165,7 @@ com_alter_common(wordlist *wl, int do_model) step = -1; wl2 = wlin; } else if (strlen(argument) > 1) { + char **arglist; arglist = TMALLOC(char*, 4); /* copy argument */ arglist[0] = copy_substring(argument, eqptr);