Commit 7bcba766 authored by David Gibson's avatar David Gibson

memmem: Remove void * arithmetic warning

haystack is a void *, so we can't do pointer arithmetic on it uncasted.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 291237b4
/* CC0 (Public domain) - see LICENSE file for details */
#include "config.h"
#include <string.h>
#include <ccan/memmem/memmem.h>
......@@ -15,7 +17,7 @@ void *memmem(const void *haystack, size_t haystacklen,
p = haystack;
for (p = haystack;
(p + needlelen) <= (haystack + haystacklen);
(p + needlelen) <= ((const char *)haystack + haystacklen);
p++)
if (memcmp(p, needle, needlelen) == 0)
return (void *)p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment