From 0251bdb0a58fae9fa1561bdd65819dc7267f77f3 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 5 Jan 2005 19:05:04 +0000
Subject: [PATCH] fix display problem caused by the memory corruption fix

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2237 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/winio.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/winio.c b/src/winio.c
index a7007e59..7d86081e 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2470,7 +2470,13 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
 	start_index += wide_buf_len;
     }
 
+    if (index < alloc_len)
+	converted[index] = '\0';
+
+    /* Make sure converted takes up no more than len columns. */
+    index = actual_x(converted, len);
     null_at(&converted, index);
+
     return converted;
 }
 
-- 
GitLab