[PATCH v2 2/4] utf8: fix comment for utf8_strnwidth()
- From
Dirk Gouders <dirk@gouders.net>
- Date
- Nov 18, 2026, 21:08 UTC
- Message-ID
- <20261118-master-v2-2-3f2aaec15d31@gouders.net>
- In-Reply-To
- <20261118-master-v2-0-3f2aaec15d31@gouders.net>
The comment for utf8_strnwidth() states it returns strlen() for cases when the given string doesn't look like valid utf8, but it returns its argument len in such cases.
Fix the comment accordingly.
Signed-off-by: Dirk Gouders <dirk@gouders.net> --- utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utf8.c b/utf8.c index d0546ab31f..b43f84a03d 100644 --- a/utf8.c +++ b/utf8.c @@ -218,7 +218,7 @@ int utf8_width(const char **start, size_t *remainder_p) /* * Returns the total number of columns required by a null-terminated - * string, assuming that the string is utf8. Returns strlen() instead + * string, assuming that the string is utf8. Returns len instead * if the string does not look like a valid utf8 string. */ int utf8_strnwidth(const char *string, size_t len, int skip_ansi)
-- 2.55.0