commit 06b1fcad13758750bea4b8604e364af861afa938
parent 92b8d6fb24367ed652aacd952332cbc2ccf6030e
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 24 Apr 2016 21:44:11 +0200
tabbing: fix erroneous use of strnlenpt()
Names could be strings of multibyte characters, so they could be more
than COLS - 1 bytes long and still be less than COLS - 1 columns wide.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/files.c b/src/files.c
@@ -2848,7 +2848,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place,
/* Find the length of the longest among the choices. */
for (match = 0; match < num_matches; match++) {
- size_t namelen = strnlenpt(matches[match], COLS - 1);
+ size_t namelen = strlenpt(matches[match]);
if (namelen > longest_name)
longest_name = namelen;