aboutsummaryrefslogtreecommitdiff
path: root/string/tst-strtok.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-21 15:39:07 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-21 15:39:07 +0000
commit1999031e0438e50a8037d2e3022a55c4db94637a (patch)
treebcc41208d3d12f040cccea381f8ab94196f7a712 /string/tst-strtok.c
parentb85b1334458711657a4cbea0bf2954936d67a4a4 (diff)
downloadglibc-1999031e0438e50a8037d2e3022a55c4db94637a.zip
glibc-1999031e0438e50a8037d2e3022a55c4db94637a.tar.gz
glibc-1999031e0438e50a8037d2e3022a55c4db94637a.tar.bz2
Update.
2001-02-21 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i686/strtok.S: Continue to return NULL after the first time this happened. 2001-02-21 Andreas Jaeger <aj@suse.de> * string/tst-strtok.c: New testcase, reported by Andrew Church <achurch@achurch.org>.
Diffstat (limited to 'string/tst-strtok.c')
-rw-r--r--string/tst-strtok.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/string/tst-strtok.c b/string/tst-strtok.c
new file mode 100644
index 0000000..ed3400d
--- /dev/null
+++ b/string/tst-strtok.c
@@ -0,0 +1,23 @@
+/* Testcase for strtok reported by Andrew Church <achurch@achurch.org>. */
+#include <stdio.h>
+#include <string.h>
+
+int
+main (void)
+{
+ char buf[1] = { 0 };
+ int result = 0;
+
+ if (strtok (buf, " ") != NULL)
+ {
+ puts ("first strtok call did return NULL");
+ result = 1;
+ }
+ else if (strtok (NULL, " ") != NULL)
+ {
+ puts ("second strtok call did return NULL");
+ result = 1;
+ }
+
+ return result;
+}