Blame string/tst-strtok.c
|
Packit |
6c4009 |
/* Testcase for strtok reported by Andrew Church <achurch@achurch.org>. */
|
|
Packit |
6c4009 |
#include <stdio.h>
|
|
Packit |
6c4009 |
#include <string.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
int
|
|
Packit |
6c4009 |
do_test (void)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
char buf[1] = { 0 };
|
|
Packit |
6c4009 |
int result = 0;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if (strtok (buf, " ") != NULL)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
puts ("first strtok call did not return NULL");
|
|
Packit |
6c4009 |
result = 1;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
else if (strtok (NULL, " ") != NULL)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
puts ("second strtok call did not return NULL");
|
|
Packit |
6c4009 |
result = 1;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
return result;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <support/test-driver.c>
|