add Ulf Harnhammar's input_tab() segfault fix

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2101 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-11-16 02:23:10 +00:00
parent 9df069cc5f
commit 8091d334a3
2 changed files with 4 additions and 1 deletions

View File

@ -173,6 +173,9 @@ CVS code -
open_prevfile(), open_nextfile()
- Translate the "New Buffer" string when displaying "Switched
to" messages on the statusbar. (DLR)
input_tab()
- Fix snprintf() call so that we don't segfault when trying to
complete a filename containing %'s. (Ulf Harnhammar)
- global.c:
shortcut_init()
- Remove redundant NANO_SMALL #ifdef. (DLR)

View File

@ -2406,7 +2406,7 @@ char *input_tab(char *buf, int place, bool *lastwastab, int *newplace,
/* make each filename shown be the same length as the
longest filename, with two spaces at the end */
snprintf(foo, longestname + 1, matches[i]);
snprintf(foo, longestname + 1, "%s", matches[i]);
while (strlen(foo) < longestname)
strcat(foo, " ");