From a405c151df74d4d3b4d06c38feff6458bef375a9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 19 Aug 2018 13:23:21 +0200 Subject: Add str[n]caseeq[null] and some tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- memrchr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'memrchr.c') diff --git a/memrchr.c b/memrchr.c index 5028158..1c7f713 100644 --- a/memrchr.c +++ b/memrchr.c @@ -19,8 +19,8 @@ libsimple_memrchr(const void *s_, int c, size_t n_) int main(void) { - assert(!strcmp(libsimple_memrchr("1234512345", '3', sizeof("1234512345") - 1), "345")); - assert(!strcmp(libsimple_memrchr("1234512345", '5', sizeof("1234512345") - 1), "5")); + assert(!strcmpnul(libsimple_memrchr("1234512345", '3', sizeof("1234512345") - 1), "345")); + assert(!strcmpnul(libsimple_memrchr("1234512345", '5', sizeof("1234512345") - 1), "5")); assert(!libsimple_memrchr("1234512345", 'x', sizeof("1234512345") - 1)); return 0; } -- cgit v1.2.3-70-g09d2