Do it the same way as in strrchr_m()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jan 20 12:56:27 UTC 2026 on atb-devel-224
_PUBLIC_ char *strchr_m(const char *src, char c)
{
const char *s;
- struct smb_iconv_handle *ic = get_iconv_handle();
+ struct smb_iconv_handle *ic = NULL;
if (src == NULL) {
return NULL;
}
s = src;
#endif
+ ic = get_iconv_handle();
+
while (*s) {
size_t size;
codepoint_t c2 = next_codepoint_handle(ic, s, &size);