From 2db5f0145d7ab9f449d83c549fa5f5ea417d9747 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 30 May 2013 17:21:16 +0200 Subject: [PATCH] inpcom.c, local scope for `str' --- src/frontend/inpcom.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 64aeb877d..072615fbc 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2010,7 +2010,7 @@ static char* inp_fix_subckt(struct names *subckt_w_params, char *s) { struct line *head = NULL, *newcard = NULL, *start_card = NULL, *end_card = NULL, *prev_card = NULL, *c = NULL; - char *equal, *beg, *buffer, *ptr1, *ptr2, *str, *new_str = NULL; + char *equal, *beg, *buffer, *ptr1, *ptr2, *new_str = NULL; char keep; int num_params = 0, i = 0, bracedepth = 0; /* find first '=' */ @@ -2073,9 +2073,8 @@ inp_fix_subckt(struct names *subckt_w_params, char *s) } newcard = alloc(struct line); - str = strdup(ptr1); - newcard->li_line = str; + newcard->li_line = strdup(ptr1); newcard->li_next = NULL; if (start_card == NULL) @@ -2111,9 +2110,8 @@ inp_fix_subckt(struct names *subckt_w_params, char *s) beg = p1; newcard = alloc(struct line); - str = buf; - newcard->li_line = str; + newcard->li_line = buf; newcard->li_next = NULL; if (start_card == NULL) @@ -2141,7 +2139,7 @@ inp_fix_subckt(struct names *subckt_w_params, char *s) if (new_str == NULL) { new_str = strdup(c->li_line); } else { - str = new_str; + char *str = new_str; new_str = TMALLOC(char, strlen(str) + strlen(c->li_line) + 2); sprintf(new_str, "%s %s", str, c->li_line); tfree(str);