From 5db1b0e9a04aba9cd44cd2e6a35e5e5367b39445 Mon Sep 17 00:00:00 2001 From: Hisham Date: Mon, 30 May 2016 12:22:33 -0300 Subject: Remove extra checks made redundant by XAlloc. --- StringUtils.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/StringUtils.c b/StringUtils.c index 173caba5..4465fb15 100644 --- a/StringUtils.c +++ b/StringUtils.c @@ -69,13 +69,7 @@ char** String_split(const char* s, char sep, int* n) { ctr++; if (ctr == blocks) { blocks += rate; - char** newOut = (char**) xRealloc(out, sizeof(char*) * blocks); - if (newOut) { - out = newOut; - } else { - blocks -= rate; - break; - } + out = (char**) xRealloc(out, sizeof(char*) * blocks); } s += size + 1; } @@ -86,10 +80,7 @@ char** String_split(const char* s, char sep, int* n) { out[ctr] = token; ctr++; } - char** newOut = xRealloc(out, sizeof(char*) * (ctr + 1)); - if (newOut) { - out = newOut; - } + out = xRealloc(out, sizeof(char*) * (ctr + 1)); out[ctr] = NULL; *n = ctr; return out; -- cgit v1.2.3