Jeffrey Walton wrote: > > if (needle._nbytes == 0) > > return 0; > > + if (haystack._nbytes == 0) > > + return -1; > > void *found = > > memmem (haystack._data, haystack._nbytes, needle._data, > > needle._nbytes); > > if (found != NULL) > > Clang is complaining haystack._data is NULL, not needle._nbytes is 0.
The set of inputs with haystack._data == NULL is a subset of the set of inputs with haystack._nbytes == 0. Bruno