]> git.wh0rd.org Git - nano.git/commitdiff
set the value of alloc_len properly again, as in DB's patch, in order to
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 4 Jan 2005 03:09:55 +0000 (03:09 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 4 Jan 2005 03:09:55 +0000 (03:09 +0000)
avoid memory corruption problems

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/winio.c

index f04bd5a38d1d6990502ce00c86eac189e379ccb4..d32403a2f57056d9e3a2489343f10f82daa990d4 100644 (file)
@@ -2288,7 +2288,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
     assert(column <= start_col);
 
     alloc_len = display_string_len(buf + start_index, start_col,
-       start_col + COLS);
+       start_col + len) + 2;
     converted = charalloc(alloc_len + 1);
     index = 0;