regex memory corruption regression test
[libc-test] / src / regression / wcsstr-false-negative.c
1 // commit 476cd1d96560aaf7f210319597556e7fbcd60469 2014-04-18
2 // wcsstr (strstr and memmem) failed to match repetitive needles in some cases
3 #include <wchar.h>
4 #include "test.h"
5
6 int main(int argc, char* argv[])
7 {
8         wchar_t const *haystack = L"playing play play play always";
9         wchar_t const *needle = L"play play play";
10         wchar_t *p = wcsstr(haystack, needle);
11         if (p != haystack+8)
12                 t_error("wcsstr(L\"%S\",L\"%S\") failed: got %p, want %p\n", haystack, needle, p, haystack+8);
13         return t_status;
14 }