The above description isn't very clear to me. Problems:
- strncmp compares prefixes of \0-terminated strings. This function
compares two binary buffers which can contain \0
- strncmp is a comparison function and can even be used with functions
like qsort (for operations like "sort on the first two characters").
This function returns 0 or nonzero.
Would something like
/* true if buffers have the same length and are byte-for-byte identical */
int bufeq(const char *, int, const char *, int);
(or buf_equal, array_equal etc) make sense?