summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-05-30 12:22:33 -0300
committerHisham <hisham@gobolinux.org>2016-05-30 12:22:33 -0300
commit5db1b0e9a04aba9cd44cd2e6a35e5e5367b39445 (patch)
tree79ac41fe28e09e454e64a50e8e5f25ae67794f33
parent4674b4a7320bb6b003a4e3b3840027573691e60d (diff)
Remove extra checks made redundant by XAlloc.
-rw-r--r--StringUtils.c13
1 files 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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy