From 67a395794b678d7da053c3daf61eb12d3f9437f2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 12 Nov 2017 14:44:35 +0100 Subject: Split into multiple units MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- memends.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 memends.c (limited to 'memends.c') diff --git a/memends.c b/memends.c new file mode 100644 index 0000000..1dde636 --- /dev/null +++ b/memends.c @@ -0,0 +1,15 @@ +/* See LICENSE file for copyright and license details. */ +#include "libsimple.h" + + +int +libsimple_memends(const void *s_, size_t n, const void *t_, size_t m) +{ + const char *s = s_, *t = t_; + if (n < m) + return 0; + while (n--, m--) + if (s[n] != t[m]) + return 0; + return 1; +} -- cgit v1.2.3-70-g09d2