demerphq wrote: >So the difference with the 'str' version is that str() considers a >null byte to be end of string, and mem() does not. Is there any case >where using memcmp() instead of str[n]cmp() is wrong for this type of >macro? Yes. In mem* the length argument states absolutely the length of the operands, but in strn* the length argument states the *maximum* length of the operands, with a nul able to terminate them earlier. Thus applying a mem* function where a strn* function is really needed may result in reading past the end of an operand, possibly into unmapped memory. -zeframThread Previous | Thread Next