Suggested by Eric Blake <ebb9@byu.net>.
2009-05-26 Simon Josefsson <simon@josefsson.org>
* tests/test-strstr.c: Add another self-test.
+ * tests/test-strstr.c: Rewrite to use malloc/strcpy instead of
+ strdup. Suggested by Eric Blake <ebb9@byu.net>.
2009-05-23 Bruno Haible <bruno@clisp.org>
{
/* See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 */
- char *input = strdup ("aBaaaaaaaaaaax");
- const char *result = strstr (input, "B1x");
+ const char *fix = "aBaaaaaaaaaaax";
+ char *input = malloc (strlen (fix) + 1);
+ const char *result;
+
+ strcpy (input, fix);
+ result = strstr (input, "B1x");
ASSERT (result == NULL);
free (input);
}