tftp-hpa-google/lib/xstrdup.c
2007-01-15 01:20:41 -08:00

20 lines
237 B
C

/*
* xstrdup.c
*
* Simple error-checking version of strdup()
*
*/
#include "config.h"
char *xstrdup(const char *s)
{
char *p = strdup(s);
if ( !p ) {
fprintf(stderr, "Out of memory!\n");
exit(128);
}
return p;
}