display: when converting tabs, don't go beyond the screen width

This fixes https://savannah.gnu.org/bugs/?51427.
master
David Lawrence Ramsey 2017-07-09 15:35:48 -05:00 committed by Benno Schulenberg
parent ecc7c26641
commit 4f3249de56
1 changed files with 1 additions and 1 deletions

View File

@ -1902,7 +1902,7 @@ char *display_string(const char *buf, size_t column, size_t span, bool isdata)
converted[index++] = ' ';
column++;
/* Fill the tab up with the required number of spaces. */
while (column % tabsize != 0) {
while (column % tabsize != 0 && column < beyond) {
converted[index++] = ' ';
column++;
}