aboutsummaryrefslogtreecommitdiff
path: root/tst
diff options
context:
space:
mode:
Diffstat (limited to 'tst')
-rw-r--r--tst/.svnignore1
-rw-r--r--tst/cut.c16
-rw-r--r--tst/strlen.c9
3 files changed, 26 insertions, 0 deletions
diff --git a/tst/.svnignore b/tst/.svnignore
index a05d151..f27c240 100644
--- a/tst/.svnignore
+++ b/tst/.svnignore
@@ -1,3 +1,4 @@
*.o
size
strtok
+strlen
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);
+}
+
diff --git a/tst/strlen.c b/tst/strlen.c
new file mode 100644
index 0000000..7762570
--- /dev/null
+++ b/tst/strlen.c
@@ -0,0 +1,9 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ printf ("%d\n", strlen (""));
+ return 0;
+}