summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4/eval.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/eval.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/eval.c')
-rw-r--r--usr.bin/m4/eval.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 7133013..ced63cd 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -86,6 +86,7 @@ register int td;
{
register int c, n;
static int sysval = 0;
+ char *p;
#ifdef DEBUG
printf("argc = %d\n", argc);
@@ -352,7 +353,9 @@ register int td;
* dom4wrap - set up for
* wrap-up/wind-down activity
*/
- m4wraps = (argc > 2) ? xstrdup(argv[2]) : null;
+ if ((p = strdup(argv[2])) == NULL)
+ err(1, "strdup");
+ m4wraps = (argc > 2) ? p : null;
break;
case EXITTYPE:
@@ -472,7 +475,8 @@ register char *defn;
if (!*defn)
p->defn = null;
else
- p->defn = xstrdup(defn);
+ if ((p->defn = strdup(defn)) == NULL)
+ err(1, "strdup");
p->type = MACRTYPE;
}
@@ -515,7 +519,8 @@ register char *defn;
if (!*defn)
p->defn = null;
else
- p->defn = xstrdup(defn);
+ if ((p->defn = strdup(defn)) == NULL)
+ err(1, "strdup");
p->type = MACRTYPE;
}
OpenPOWER on IntegriCloud