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)
|
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;
|
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;
|
char keep;
|
||||||
int num_params = 0, i = 0, bracedepth = 0;
|
int num_params = 0, i = 0, bracedepth = 0;
|
||||||
/* find first '=' */
|
/* find first '=' */
|
||||||
|
|
@ -2073,9 +2073,8 @@ inp_fix_subckt(struct names *subckt_w_params, char *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
newcard = alloc(struct line);
|
newcard = alloc(struct line);
|
||||||
str = strdup(ptr1);
|
|
||||||
|
|
||||||
newcard->li_line = str;
|
newcard->li_line = strdup(ptr1);
|
||||||
newcard->li_next = NULL;
|
newcard->li_next = NULL;
|
||||||
|
|
||||||
if (start_card == NULL)
|
if (start_card == NULL)
|
||||||
|
|
@ -2111,9 +2110,8 @@ inp_fix_subckt(struct names *subckt_w_params, char *s)
|
||||||
beg = p1;
|
beg = p1;
|
||||||
|
|
||||||
newcard = alloc(struct line);
|
newcard = alloc(struct line);
|
||||||
str = buf;
|
|
||||||
|
|
||||||
newcard->li_line = str;
|
newcard->li_line = buf;
|
||||||
newcard->li_next = NULL;
|
newcard->li_next = NULL;
|
||||||
|
|
||||||
if (start_card == NULL)
|
if (start_card == NULL)
|
||||||
|
|
@ -2141,7 +2139,7 @@ inp_fix_subckt(struct names *subckt_w_params, char *s)
|
||||||
if (new_str == NULL) {
|
if (new_str == NULL) {
|
||||||
new_str = strdup(c->li_line);
|
new_str = strdup(c->li_line);
|
||||||
} else {
|
} else {
|
||||||
str = new_str;
|
char *str = new_str;
|
||||||
new_str = TMALLOC(char, strlen(str) + strlen(c->li_line) + 2);
|
new_str = TMALLOC(char, strlen(str) + strlen(c->li_line) + 2);
|
||||||
sprintf(new_str, "%s %s", str, c->li_line);
|
sprintf(new_str, "%s %s", str, c->li_line);
|
||||||
tfree(str);
|
tfree(str);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue