aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c
index 3c231294..8e085b0c 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -30,6 +30,17 @@ xmalloc (int n)
return(p);
}
+XMALLOCTYPE *
+xrealloc (XMALLOCTYPE *p, int n)
+{
+ if (p == 0)
+ return xmalloc (n);
+ p = (XMALLOCTYPE *) realloc(p, n);
+ if (p == (XMALLOCTYPE *) 0)
+ error(PS_UNDEFINED, errno, "realloc failed");
+ return p;
+}
+
char *xstrdup(const char *s)
{
char *p;