2001-02-21 16:39:07 +01:00
|
|
|
/* 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)
|
|
|
|
{
|
2001-02-22 14:46:25 +01:00
|
|
|
puts ("first strtok call did not return NULL");
|
2001-02-21 16:39:07 +01:00
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
else if (strtok (NULL, " ") != NULL)
|
|
|
|
{
|
2001-02-22 14:46:25 +01:00
|
|
|
puts ("second strtok call did not return NULL");
|
2001-02-21 16:39:07 +01:00
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|