From: Dirk Gouders <dirk@gouders.net>
To: git@vger.kernel.org
Cc: Dirk Gouders <dirk@gouders.net>
Subject: [PATCH 2/2] utf8: fix comment for utf8_strnwidth()
Date: Mon, 16 Nov 2026 19:57:01 +0100 [thread overview]
Message-ID: <20261116-master-v1-2-dc2a50ce0aa0@gouders.net> (raw)
In-Reply-To: <20261116-master-v1-0-dc2a50ce0aa0@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 7e050bb2c4..e6d1510b60 100644
--- a/utf8.c
+++ b/utf8.c
@@ -205,7 +205,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
prev parent reply other threads:[~2026-11-16 18:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 18:56 [PATCH 0/2] utf8: two minor fixes Dirk Gouders
2026-11-16 18:57 ` [PATCH 1/2] utf8: respect bounds in utf8_strnwidth() Dirk Gouders
2026-11-17 0:02 ` Junio C Hamano
2026-11-17 15:15 ` Dirk Gouders
2026-11-17 16:18 ` Junio C Hamano
2026-11-17 17:57 ` Dirk Gouders
2026-11-17 18:11 ` Junio C Hamano
2026-11-16 18:57 ` Dirk Gouders [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116-master-v1-2-dc2a50ce0aa0@gouders.net \
--to=dirk@gouders.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox