summaryrefslogtreecommitdiff
path: root/zap/src/memcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'zap/src/memcmp.c')
-rw-r--r--zap/src/memcmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/zap/src/memcmp.c b/zap/src/memcmp.c
index 31e5161..0fdf13a 100644
--- a/zap/src/memcmp.c
+++ b/zap/src/memcmp.c
@@ -6,16 +6,18 @@
#include <zap/priv.h>
+#include <zap/mem.h>
+
#include <stddef.h>
int_least8_t zap_memcmp(void const * const _lstr,size_t const _num,void const * const _rstr) {
- unsigned char const * lpos = (unsigned char const *)_lstr;
- unsigned char const * rpos = (unsigned char const *)_rstr;
+ unsigned char const * lpos = _lstr;
+ unsigned char const * rpos = _rstr;
unsigned char const * const afterlbuf = lpos + _num;
for (;lpos != afterlbuf;++lpos,++rpos) {
unsigned char const lbyte = *lpos;
unsigned char const rbyte = *rpos;
- sus_likely (lbyte != rbyte) {return lbyte < rbyte ? INT8_MIN : INT8_MAX;}
+ sus_likely (lbyte != rbyte) {return lbyte < rbyte ? INT_LEAST8_MIN : INT_LEAST8_MAX;}
}
return 0x0;
}