#include <string.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ fflush (stderr); \
abort (); \
} \
} \
caused by SIGALRM. All known platforms that lack alarm also have
a quadratic strstr, and the replacement strstr is known to not
take too long. */
+ signal (SIGALRM, SIG_DFL);
alarm (50);
#endif
result = strstr (haystack, needle);
ASSERT (result == haystack + m);
}
- if (needle != NULL)
- free (needle);
- if (haystack != NULL)
- free (haystack);
+ free (needle);
+ free (haystack);
}
/* Sublinear speed is only possible in memmem; strstr must examine