1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 05:31:53 +02:00

b2/subst.c (parse_var): use unique_n

This commit is contained in:
Werner Almesberger 2012-05-23 16:47:34 -03:00
parent b9066c6331
commit a537cc5503

View File

@ -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;