util: adds util function SCBufferCmp

Compares two buffers with their two sizes
pull/6409/head
Philippe Antoine 5 years ago
parent 13a6eb3522
commit f0012f97b2

@ -377,5 +377,15 @@ static inline int SCMemcmpLowercase(const void *s1, const void *s2, size_t len)
#endif /* SIMD */
static inline int SCBufferCmp(const void *s1, size_t len1, const void *s2, size_t len2)
{
if (len1 == len2) {
return SCMemcmp(s1, s2, len1);
} else if (len1 < len2) {
return -1;
}
return 1;
}
#endif /* __UTIL_MEMCMP_H__ */

Loading…
Cancel
Save