From c2c4683b4bec42708cf02d05843a0f174da29989 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 10 Jun 2017 09:45:59 +0200 Subject: [PATCH] device.c, #11/19, shrink scope of variable 'wlin' --- src/frontend/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/device.c b/src/frontend/device.c index 658e848c4..9969ca047 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1124,7 +1124,7 @@ com_alter_common(wordlist *wl, int do_model) /* DIE 2009_02_06 */ int i, wlen, maxelem = 3; - wordlist *wl2, *wlin; + wordlist *wl2; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -1146,7 +1146,6 @@ com_alter_common(wordlist *wl, int do_model) If 'expression' is a vector (e.g. [ 1.0 1.2 1.4 ] ), its elements in wl2 have to follow the splitting. wl_splice() will take care of this. */ - wlin = wl; for (; wl; wl = wl->wl_next) { char *argument = wl->wl_word; /* searching for '=' ... */ @@ -1180,6 +1179,7 @@ com_alter_common(wordlist *wl, int do_model) 'alter device parameter value parameter value [ parameter value ]' multiple param value pairs are not supported! */ + wordlist *wlin = parent->wl_next; wlen = wl_length(wlin); /* Return the last element of wlin */ wlin = wl_nthelem(100, wlin); /* no more than 100 vector elements */