From 1f8a958cf61bc473bb0aa05a133ad40412910811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 9 May 2026 17:56:53 +0200 Subject: New upstream version 5.4 --- src/string.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index e9c162d..445b466 100644 --- a/src/string.c +++ b/src/string.c @@ -7,6 +7,9 @@ * General Public License as published by the Free Software Foundation; * either version 2.1 or (at your option) any later version. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include #include /* nextafter */ @@ -16,6 +19,9 @@ #include #include #include +#ifdef HAVE_STRINGS_H +# include +#endif #include #include #include "internal.h" @@ -176,7 +182,6 @@ EXPORT_SYMBOL void *HX_memmem(const void *vspace, size_t spacesize, const char *space = vspace, *point = vpoint; const char *head, *end; size_t tailsize; - char *tail; if (pointsize == 0) return const_cast1(void *, vspace); @@ -185,9 +190,9 @@ EXPORT_SYMBOL void *HX_memmem(const void *vspace, size_t spacesize, /* Do a BM-style trailer search and reduce calls to memcmp */ head = space + (pointsize - 1); - tail = memchr(head, point[pointsize-1], spacesize - (pointsize - 1)); + const char *tail = memchr(head, point[pointsize-1], spacesize - (pointsize - 1)); if (tail == NULL || pointsize == 1) - return tail; + return const_cast1(char *, tail); end = space + spacesize; do { head = tail - pointsize + 1; -- cgit v1.2.3