From 16a7fd4bfc7858500f6fc549e35809d67e31dae7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 11 Jan 2017 17:22:46 +0100 Subject: [PATCH] screen: don't compare a character index with a column position This addresses part of https://savannah.gnu.org/patch/?9216. Reported-by: David Lawrence Ramsey --- src/winio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 7509a2cc..e401d7bc 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2711,7 +2711,7 @@ int update_line(filestruct *fileptr, size_t index) #endif if (page_start > 0) mvwaddch(edit, line, margin, '$'); - if (strlenpt(fileptr->data) > page_start + editwincols) + if (strlenpt(fileptr->data + page_start) > editwincols) mvwaddch(edit, line, COLS - 1, '$'); #ifndef NANO_TINY } else {