aboutsummaryrefslogtreecommitdiffstats
path: root/String.c
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf@debian.org>2011-11-26 15:58:33 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:30 +0200
commitc65eb8be811f59b55d64d9e7654c33708de79ad9 (patch)
treeee6e542b988263c49f0e1200d6aa5aa635667fe8 /String.c
parent38174fffd79f54a8be7642bf170a2320b29e8063 (diff)
parenteaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (diff)
downloaddebian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.tar.gz
debian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.tar.bz2
debian_htop-c65eb8be811f59b55d64d9e7654c33708de79ad9.zip
Imported Debian patch 1.0-1debian/1.0-1
Diffstat (limited to 'String.c')
-rw-r--r--String.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/String.c b/String.c
index 6a6db94..81e9eee 100644
--- a/String.c
+++ b/String.c
@@ -1,6 +1,6 @@
/*
htop
-(C) 2004-2010 Hisham H. Muhammad
+(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
@@ -55,7 +55,8 @@ inline int String_eq(const char* s1, const char* s2) {
return (strcmp(s1, s2) == 0);
}
-char** String_split(const char* s, char sep) {
+char** String_split(const char* s, char sep, int* n) {
+ *n = 0;
const int rate = 10;
char** out = (char**) malloc(sizeof(char*) * rate);
int ctr = 0;
@@ -83,6 +84,7 @@ char** String_split(const char* s, char sep) {
}
out = realloc(out, sizeof(char*) * (ctr + 1));
out[ctr] = NULL;
+ *n = ctr;
return out;
}

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