The purpose of the "bounds" test is to check that the function does not
overread the array bounds. The old unit test, copied from the strlcpy()
one, always ensured that we see the character c memccpy() is looking for
in the source array before the array ends. While this is correct for
strlcpy(), memccpy()'s specification does not guarantee that the c is
present within the given size limit.
The updated test handles this case better, ensuring that the source
array ends early if c is not supposed to be present.
With this updated test, a bug @getz found in my "baseline" memccpy
implementation now leads to the unit test failing with a crash.
The bug is as follows: if memccpy processes an input array that starts
no more than 16 bytes before the end of a page followed by an unmapped
or inaccessible page and does not cross the page boundary and if the
character we are looking for does not appear in the array, memccpy
errorneously reads another 16 bytes off the unmapped page, causing a
crash. A fix will follow in a second DR.