Skip to content

Commit

Permalink
memmem(): fix for compile error wit _MSC_VER
Browse files Browse the repository at this point in the history
libacars/util.c(252): error C2036: 'const void *': unknown size

Thx @gvanem
  • Loading branch information
szpajder committed Jan 4, 2025
1 parent 137f855 commit f18cedb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libacars/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ void *memmem(void const *haystack, size_t haystack_len, void const *needle, size
return NULL;
}

void const *haystack_end = (char const *)haystack + haystack_len - needle_len;
while (haystack <= haystack_end) {
void const *match = memchr(haystack, *(char const *)needle, haystack_end - haystack + 1);
char const *haystack_end = (char const *)haystack + haystack_len - needle_len;
while (haystack <= (const void *)haystack_end) {
const void *match = memchr(haystack, *(char const *)needle, haystack_end - (char const *)haystack + 1);
if (match == NULL) {
return NULL;
}
Expand Down

0 comments on commit f18cedb

Please sign in to comment.