Make UBSan happy

This commit is contained in:
Kovid Goyal 2026-09-01 20:31:30 +05:30
parent b54bfbb4f8
commit 35f88faeea
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -44,6 +44,7 @@ static void drop_pop_request(Window *w);
static size_t
count_occurrences(const char *str, size_t len, char target) {
if (!str) return 0;
size_t count = 0;
const char *ptr = str;
while ((ptr = memchr(ptr, target, len - (ptr - str))) != NULL) {