aboutsummaryrefslogtreecommitdiff
path: root/tst/cut.c
diff options
context:
space:
mode:
authorbeber <beber>2005-12-07 14:48:53 +0000
committerbeber <beber>2005-12-07 14:48:53 +0000
commit2035bb64f7775c24f865bf29be1f458e8dfae932 (patch)
treeb79d426dcff309bee32f568dd23ff3ce8a77e7e0 /tst/cut.c
parentdon't use valgrind (diff)
downloadespik-2035bb64f7775c24f865bf29be1f458e8dfae932.tar.xz
use espik_debug_print everywhere
more ignore corect debug macro when there is no arguments some indent some // -> /* */ add a macro for fd output (stderr, stdout) include debug and so ..
Diffstat (limited to 'tst/cut.c')
-rw-r--r--tst/cut.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tst/cut.c b/tst/cut.c
new file mode 100644
index 0000000..4567a87
--- /dev/null
+++ b/tst/cut.c
@@ -0,0 +1,16 @@
+char** separate_commandline (char *msg, char sep)
+{
+ unsigned int len;
+ char** two_words;
+
+ /* Yes, do nothing, just get len ! */
+ for (len = 0; msg[len] != sep; len++);
+ two_words = malloc (sizeof(char*) * 2);
+
+ msg[len] = '\0';
+ two_words[0] = msg;
+ two_words[1] = msg + len + 1;
+
+ return (two_words);
+}
+