remap: *actually* build, and fix masked logic errors
[tftp-hpa.git] / lib / xstrdup.c
blob05e3054bff7cdddc29fbe69e5842ca080dd17597
1 /*
2 * xstrdup.c
4 * Simple error-checking version of strdup()
6 */
8 #include "config.h"
10 char *xstrdup(const char *s)
12 char *p = strdup(s);
14 if (!p) {
15 fprintf(stderr, "Out of memory!\n");
16 exit(128);
19 return p;