mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 22:03:08 +02:00
b2/subst.c (parse_var): use unique_n
This commit is contained in:
parent
b9066c6331
commit
a537cc5503
@ -176,12 +176,8 @@ static const char *parse_var(struct chunk *c, const char *s)
|
|||||||
c->type = ct_sub;
|
c->type = ct_sub;
|
||||||
c->u.sub = *s-'0';
|
c->u.sub = *s-'0';
|
||||||
} else if (isalnum(*s)) {
|
} else if (isalnum(*s)) {
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
c->type = ct_var;
|
c->type = ct_var;
|
||||||
tmp = stralloc_n(s, t-s);
|
c->u.var = unique_n(s, t-s);
|
||||||
c->u.var = unique(tmp);
|
|
||||||
free(tmp);
|
|
||||||
} else {
|
} else {
|
||||||
c->type = ct_sub;
|
c->type = ct_sub;
|
||||||
c->u.sub = 0;
|
c->u.sub = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user