commit 4f3249de569b5f90df53e65e1bcd9d0913d7ce65
parent ecc7c266416503ba22c42c7e16af38388b5d5b87
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sun, 9 Jul 2017 15:35:48 -0500
display: when converting tabs, don't go beyond the screen width
This fixes https://savannah.gnu.org/bugs/?51427.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/winio.c b/src/winio.c
@@ -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++;
}