From 82f4758410d9e4f149ea916504a407ea890d9f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Piwi=C5=84ski?= Date: Mon, 1 Dec 2025 16:42:54 +0100 Subject: [PATCH] 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 --- libio/strops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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