X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c1fa53426d4f4db5c1fe697d915d30247fd5d09a..b69c3463223ed1207861d7a9b0ec0a06064696ca:/tools/tesh2/src/explode.c diff --git a/tools/tesh2/src/explode.c b/tools/tesh2/src/explode.c deleted file mode 100644 index 63b79932ca..0000000000 --- a/tools/tesh2/src/explode.c +++ /dev/null @@ -1,37 +0,0 @@ -#include - char ** explode(char separator, const char *string) -{ - int pos = 0; - int i, len = 1; - int number = 2; - char **table; - const char *p = string; - for (i = 0; p[i] != '\0'; i++) - if (p[i] == separator) - number++; - table = (char **) calloc(number, sizeof(char *)); - i = 0; - while (*p++ != '\0') - { - if (*p == separator) - { - table[i] = (char *) calloc(len + 1, sizeof(char)); - strncpy(table[i], string + pos, len); - pos += len + 1; - len = 0; - i++; - } - - else - len++; - } - if (len > 1) - { - table[i] = (char *) calloc(len + 1, sizeof(char)); - strncpy(table[i], string + pos, len); - } - table[++i] = NULL; - return table; - } - -