From e5b2a65fe28267f46b8ce2a72984f30bebbfca10 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Fri, 17 Feb 2017 21:55:11 +1100 Subject: [PATCH] Remove pointless NULL test and unreachable return There is no point testing ptr for NULL - we dereference it anyway, this function can't be called with a NULL pointer for the first argument. --- source/ircaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ircaux.c b/source/ircaux.c index d9335f4..e198226 100644 --- a/source/ircaux.c +++ b/source/ircaux.c @@ -174,7 +174,7 @@ char * n_malloc_strcpy (char **ptr, const char *src, const char *module, const c { if (!src) return *ptr = n_free(*ptr, module, file, line); - if (ptr && *ptr) + if (*ptr) { if (*ptr == src) return *ptr; @@ -183,8 +183,8 @@ char * n_malloc_strcpy (char **ptr, const char *src, const char *module, const c *ptr = n_free(*ptr, module, file, line); } *ptr = n_malloc(strlen(src) + 1, module, file, line); + return strcpy(*ptr, src); - return *ptr; } /* malloc_strcat: Yeah, right */