diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:29 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:29 +0200 |
commit | eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (patch) | |
tree | 833f3fae6e3604a439f909c245a6e35f574997d7 /String.c | |
parent | 283707c5e5bc436b78ea23bf5500cb6b16a01148 (diff) | |
download | debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.gz debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.bz2 debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.zip |
Imported Upstream version 1.0upstream/1.0
Diffstat (limited to 'String.c')
-rw-r--r-- | String.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |