diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 00:18:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 00:18:14 +0000 |
commit | d5cf32b9a40c579557415b94415d349322b140b8 (patch) | |
tree | 6f84bdc7b04bf8f7b28b07bed4da9a98243b3e8c /usr.bin/yacc/symtab.c | |
parent | f6b29b49c0f3c8936910f62561bd84f90e3bd3e3 (diff) |
string cleaning; ok tedu
Diffstat (limited to 'usr.bin/yacc/symtab.c')
-rw-r--r-- | usr.bin/yacc/symtab.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/yacc/symtab.c b/usr.bin/yacc/symtab.c index 9e500b81fe9..b17131c41a6 100644 --- a/usr.bin/yacc/symtab.c +++ b/usr.bin/yacc/symtab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: symtab.c,v 1.6 2002/02/16 21:28:00 millert Exp $ */ +/* $OpenBSD: symtab.c,v 1.7 2003/04/08 00:18:13 deraadt Exp $ */ /* $NetBSD: symtab.c,v 1.4 1996/03/19 03:21:48 jtc Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)symtab.c 5.3 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$OpenBSD: symtab.c,v 1.6 2002/02/16 21:28:00 millert Exp $"; +static char rcsid[] = "$OpenBSD: symtab.c,v 1.7 2003/04/08 00:18:13 deraadt Exp $"; #endif #endif /* not lint */ @@ -88,7 +88,7 @@ char *name; if (bp == 0) no_space(); bp->link = 0; bp->next = 0; - bp->name = MALLOC(strlen(name) + 1); + bp->name = strdup(name); if (bp->name == 0) no_space(); bp->tag = 0; bp->value = UNDEFINED; @@ -97,9 +97,6 @@ char *name; bp-> class = UNKNOWN; bp->assoc = TOKEN; - if (bp->name == 0) no_space(); - strcpy(bp->name, name); - return (bp); } |