Commit 06b1fcad authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment