From 30a56fc113a8099706f6fac5e333cbb9fbcaac90 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 11 Mar 2012 21:32:38 +0100 Subject: [PATCH] subs, localize `subs0' nobody looks at subs0, except doit(). doit() allways initializes it to NULL, and restores it on return thus its a local ... note: in error cases subs is *not* allways restored assume this to have been a bug --- src/frontend/subckt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index e24270f61..396f2a4b5 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -120,7 +120,6 @@ struct subs { */ static wordlist *modnames, *submod; -static struct subs *subs0 = NULL; static bool nobjthack = FALSE; /* flag indicating use of the experimental numparams library */ static bool use_numparams = FALSE; @@ -402,11 +401,10 @@ doit(struct line *deck) { bool gotone; wordlist *tmodnames = modnames; wordlist *tsubmod = submod; - struct subs *ts = subs0; int error; /* Save all the old stuff... */ - subs0 = NULL; + struct subs *subs0 = NULL; submod = NULL; #ifdef TRACE @@ -691,7 +689,6 @@ doit(struct line *deck) { if (error) return NULL; /* error message already reported; should free( ) */ - subs0 = ts; modnames = tmodnames; submod = tsubmod; /*