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.
master
Benno Schulenberg 2016-04-24 21:44:11 +02:00
parent 92b8d6fb24
commit 06b1fcad13
1 changed files with 1 additions and 1 deletions

View File

@ -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;