inpcom.c, local scope for `str'
This commit is contained in:
parent
78862223e4
commit
2db5f0145d
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue