From: Kacper PiwiƄski Date: Mon, 1 Dec 2025 15:42:54 +0000 (+0100) Subject: strops: use strlen instead of strchr for string length X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82f4758410d9e4f149ea916504a407ea890d9f76;p=thirdparty%2Fglibc.git strops: use strlen instead of strchr for string length For wide string the equivalent funtion __wcslen is used. This change makes it more symetrical. Reviewed-by: Florian Weimer --- diff --git a/libio/strops.c b/libio/strops.c index ec75530e14..9243a87592 100644 --- a/libio/strops.c +++ b/libio/strops.c @@ -38,7 +38,7 @@ _IO_str_init_static_internal (_IO_strfile *sf, char *ptr, size_t size, char *end; if (size == 0) - end = strchr (ptr, '\0'); + end = ptr + strlen (ptr); else if ((size_t) ptr + size > (size_t) ptr) end = ptr + size; else