mirror of https://github.com/xzeldon/htop.git
Remove extra checks made redundant by XAlloc.
This commit is contained in:
parent
4674b4a732
commit
5db1b0e9a0
|
@ -69,13 +69,7 @@ char** String_split(const char* s, char sep, int* n) {
|
||||||
ctr++;
|
ctr++;
|
||||||
if (ctr == blocks) {
|
if (ctr == blocks) {
|
||||||
blocks += rate;
|
blocks += rate;
|
||||||
char** newOut = (char**) xRealloc(out, sizeof(char*) * blocks);
|
out = (char**) xRealloc(out, sizeof(char*) * blocks);
|
||||||
if (newOut) {
|
|
||||||
out = newOut;
|
|
||||||
} else {
|
|
||||||
blocks -= rate;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
s += size + 1;
|
s += size + 1;
|
||||||
}
|
}
|
||||||
|
@ -86,10 +80,7 @@ char** String_split(const char* s, char sep, int* n) {
|
||||||
out[ctr] = token;
|
out[ctr] = token;
|
||||||
ctr++;
|
ctr++;
|
||||||
}
|
}
|
||||||
char** newOut = xRealloc(out, sizeof(char*) * (ctr + 1));
|
out = xRealloc(out, sizeof(char*) * (ctr + 1));
|
||||||
if (newOut) {
|
|
||||||
out = newOut;
|
|
||||||
}
|
|
||||||
out[ctr] = NULL;
|
out[ctr] = NULL;
|
||||||
*n = ctr;
|
*n = ctr;
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Reference in New Issue