tst-strtok.c 474 B

12345678910111213141516171819202122232425
  1. /* Testcase for strtok reported by Andrew Church <achurch@achurch.org>. */
  2. #include <stdio.h>
  3. #include <string.h>
  4. int
  5. do_test (void)
  6. {
  7. char buf[1] = { 0 };
  8. int result = 0;
  9. if (strtok (buf, " ") != NULL)
  10. {
  11. puts ("first strtok call did not return NULL");
  12. result = 1;
  13. }
  14. else if (strtok (NULL, " ") != NULL)
  15. {
  16. puts ("second strtok call did not return NULL");
  17. result = 1;
  18. }
  19. return result;
  20. }
  21. #include <support/test-driver.c>