summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4/look.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-07-24 14:09:47 +0000
committerobrien <obrien@FreeBSD.org>2001-07-24 14:09:47 +0000
commit0004ccf79876c8bdda19ea656a8360faae38bd8c (patch)
treefc273fb6f58ca353dc8b70c80556ee29a1278ba7 /usr.bin/m4/look.c
parentf842b779c36c44bc686f6d57b2392f5fdb3fd25b (diff)
downloadFreeBSD-src-0004ccf79876c8bdda19ea656a8360faae38bd8c.zip
FreeBSD-src-0004ccf79876c8bdda19ea656a8360faae38bd8c.tar.gz
Remove the local basename in favor of the libc version.
Remove xmalloc and xstrdup and do the error checking at the place of use.
Diffstat (limited to 'usr.bin/m4/look.c')
-rw-r--r--usr.bin/m4/look.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c
index 3635e1b..73f5a22 100644
--- a/usr.bin/m4/look.c
+++ b/usr.bin/m4/look.c
@@ -36,6 +36,8 @@
#ifndef lint
static char sccsid[] = "@(#)look.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] =
+ "$FreeBSD$";
#endif /* not lint */
/*
@@ -45,6 +47,7 @@ static char sccsid[] = "@(#)look.c 8.1 (Berkeley) 6/6/93";
*/
#include <sys/types.h>
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -89,10 +92,12 @@ char *name;
ndptr p;
h = hash(name);
- p = (ndptr) xalloc(sizeof(struct ndblock));
+ if ((p = malloc(sizeof(struct ndblock))) == NULL)
+ err(1, "malloc");
p->nxtptr = hashtab[h];
hashtab[h] = p;
- p->name = xstrdup(name);
+ if ((p->name = strdup(name)) == NULL)
+ err(1, "strdup");
return p;
}
OpenPOWER on IntegriCloud