While functions operating on strings stop reading input buffers on a null byte and will not overread the input, the memcmp function operates on bytes and does not stop on null bytes. If the size argument ( BUFSIZE-1 in the example below) is greater than the source string’s length (the length of “, Beowulf\x00” , so 10 bytes), the size argument may be incorrectly interpreted as the destination buffer’s size ( BUFSIZE bytes in the example), instead of the input string’s size.