Search code examples
cstrstr

A pure bytes version of strstr?


Is there a version of strstr that works over a fixed length of memory that may include null characters?

I could phrase my question like this: strncpy is to memcpy as strstr is to ?


Solution

  • memmem, unfortunately it's GNU-specific rather than standard C. However, it's open-source so you can copy the code (if the license is amenable to you).