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