p = (XMALLOCTYPE *) malloc(n);
if (p == (XMALLOCTYPE *) 0)
- error(PS_UNDEFINED, errno, _("malloc failed"));
+ {
+ report(stderr, _("malloc failed\n"));
+ exit(PS_UNDEFINED);
+ }
return(p);
}
return xmalloc (n);
p = (XMALLOCTYPE *) realloc(p, n);
if (p == (XMALLOCTYPE *) 0)
- error(PS_UNDEFINED, errno, _("realloc failed"));
+ {
+ report(stderr, _("realloc failed\n"));
+ exit(PS_UNDEFINED);
+ }
return p;
}
return p;
}
+#if !defined(HAVE_STRDUP)
+char *strdup(const char *s)
+{
+ char *p;
+ p = (char *) malloc(strlen(s)+1);
+ strcpy(p,s);
+ return p;
+}
+#endif /* !HAVE_STRDUP */
+
/* xmalloc.c ends here */