From 3c8530663d1cf0ee31e9bb859f999dc3b6a798d9 Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Wed, 21 Jun 2017 13:50:13 -0400 Subject: [PATCH] xstrdup() not called anywhere in source. Removed. --- advent.h | 1 - misc.c | 10 ---------- 2 files changed, 11 deletions(-) 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. -- 2.31.1