From 3e746c51b3adcf97e4d11be30bfd91c8aaf2c2ba Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Aug 2018 23:40:11 +0200 Subject: Fix and run tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- memrmem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'memrmem.c') diff --git a/memrmem.c b/memrmem.c index 713ba34..2c61998 100644 --- a/memrmem.c +++ b/memrmem.c @@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include "libsimple.h" +#ifndef TEST void * @@ -9,7 +10,7 @@ libsimple_memrmem(const void *hay_, size_t hayn, const void *sub_, size_t subn) const char *sub = sub_; if (!subn) - return hay; + return &hay[hayn]; if (hayn < subn) return NULL; if (subn == 1) @@ -26,8 +27,8 @@ libsimple_memrmem(const void *hay_, size_t hayn, const void *sub_, size_t subn) } -#ifdef TEST -#include +#else +#include "test.h" int main(void) -- cgit v1.2.3-70-g09d2