aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sed/misc.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-07-24 14:05:21 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-07-24 14:05:21 +0000
commit8e33c0a0f6baf1964c3607c363a9411a119acdcb (patch)
tree5cfbf3a709a30e3188c47d1beb93d8b2481dcaf0 /usr.bin/sed/misc.c
parent9ebd5897b2d8c91e658a3c11202fdb947e4ba2c4 (diff)
Notes
Diffstat (limited to 'usr.bin/sed/misc.c')
-rw-r--r--usr.bin/sed/misc.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c
index c9b013a8dbd9..d5ad374e7618 100644
--- a/usr.bin/sed/misc.c
+++ b/usr.bin/sed/misc.c
@@ -55,36 +55,6 @@ static const char rcsid[] =
#include "extern.h"
/*
- * malloc with result test
- */
-void *
-xmalloc(size)
- u_int size;
-{
- void *p;
-
- if ((p = malloc(size)) == NULL)
- err(1, "malloc");
- return (p);
-}
-
-/*
- * realloc with result test
- */
-void *
-xrealloc(p, size)
- void *p;
- u_int size;
-{
- if (p == NULL) /* Compatibility hack. */
- return (xmalloc(size));
-
- if ((p = realloc(p, size)) == NULL)
- err(1, "realloc");
- return (p);
-}
-
-/*
* Return a string for a regular expression error passed. This is a overkill,
* because of the silly semantics of regerror (we can never know the size of
* the buffer).
@@ -100,7 +70,8 @@ strregerror(errcode, preg)
if (oe != NULL)
free(oe);
s = regerror(errcode, preg, "", 0);
- oe = xmalloc(s);
+ if ((oe = malloc(s)) == NULL)
+ err(1, "malloc");
(void)regerror(errcode, preg, oe, s);
return (oe);
}