diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -60,14 +60,8 @@ void* erealloc(void *ptr, size_t size) char* estrdup(const char *s) { - char *d; size_t n = strlen(s) + 1; - - d = malloc(n); - if (d == NULL) - error(EXIT_FAILURE, errno, NULL); - memcpy(d, s, n); - return d; + return memcpy(emalloc(n), s, n); } void error(int eval, int err, const char* fmt, ...) |