Commit message · Matt Whitlockuse const-correct types with strchr, strstr, etc.
Because ccan/config.h #defines _GNU_SOURCE, glibc declares qualifier-
preserving generic prototypes for the twelve "qualifier-losing search
functions" (bsearch, bsearch_s, memchr, strchr, strpbrk, strrchr, strstr,
wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr), even in -std=gnu11 mode.
Several places throughout the code base were calling these search functions
and inadvertently stripping away the constness of their return values,
triggering compilation errors due to -Werror. Fix up these call sites so
that the assignments of their return values do not implicitly discard the
const qualifier.
Changelog-None
80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode