From: Aaron Traas Date: Wed, 21 Jun 2017 17:50:13 +0000 (-0400) Subject: xstrdup() not called anywhere in source. Removed. X-Git-Tag: 1.1~172 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=3c8530663d1cf0ee31e9bb859f999dc3b6a798d9;p=open-adventure.git xstrdup() not called anywhere in source. Removed. --- diff --git a/advent.h b/advent.h index a471461..b699249 100644 --- a/advent.h +++ b/advent.h @@ -89,7 +89,6 @@ extern bool oldstyle, editline, prompt; #define READ_MODE "rb" #define WRITE_MODE "wb" extern void* xmalloc(size_t size); -extern char* xstrdup(const char*); extern void packed_to_token(long, char token[]); extern void token_to_packed(char token[], long*); extern void vspeak(const char*, va_list); diff --git a/misc.c b/misc.c index b6230ec..28bd960 100644 --- a/misc.c +++ b/misc.c @@ -21,16 +21,6 @@ void* xmalloc(size_t size) return (ptr); } -char* xstrdup(const char* s) -{ - char* ptr = strdup(s); - if (ptr == NULL) { - fprintf(stderr, "Out of memory!\n"); - exit(EXIT_FAILURE); - } - return (ptr); -} - void packed_to_token(long packed, char token[6]) { // Unpack and map back to ASCII.