Back to index

glibc  2.9
tst-strtok.c
Go to the documentation of this file.
00001 /* Testcase for strtok reported by Andrew Church <achurch@achurch.org>.  */
00002 #include <stdio.h>
00003 #include <string.h>
00004 
00005 int
00006 main (void)
00007 {
00008   char buf[1] = { 0 };
00009   int result = 0;
00010 
00011   if (strtok (buf, " ") != NULL)
00012     {
00013       puts ("first strtok call did not return NULL");
00014       result = 1;
00015     }
00016   else if (strtok (NULL, " ") != NULL)
00017     {
00018       puts ("second strtok call did not return NULL");
00019       result = 1;
00020     }
00021 
00022   return result;
00023 }