Jeremiah Mahler wrote:
> Add a strnncmp() function which behaves like strncmp() except it uses
> the length of both strings instead of just one.
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?
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html