strstr() for a string that is NOT null-terminated
If you’re afraid of O(m*n) behaviour – basically, you needn’t, such cases don’t occur naturally – here’s a KMP implementation I had lying around which I’ve modified to take the length of the haystack. Also a wrapper. If you want to do repeated searches, write your own and reuse the borders array. No guarantees for … Read more