From: Chris Allegretta Date: Mon, 15 Jan 2001 17:22:27 +0000 (+0000) Subject: input_tab(): - Added null end of matchBuf for sanity (Rocco). X-Git-Tag: v0.9.99pre1~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b4c43683a52a53fd4f07d0d13602709b87cfe3b0;p=nano.git input_tab(): - Added null end of matchBuf for sanity (Rocco). git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index af7ec042..31a363e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ General - Added space and - keys to do page up and down. cwd_tab_completion(), input_tab() - Changed bare malloc/calloc calls to nmalloc (found by Rocco). + - Added null end of tmpBuf for sanity (Rocco). - nano.c: ABCD() - New function, figures out what kbinput to return given diff --git a/files.c b/files.c index ebb0acda..8248f498 100644 --- a/files.c +++ b/files.c @@ -885,6 +885,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace) matchBuf = (char *) nmalloc((strlen(buf) + 2) * sizeof(char)); strncpy(matchBuf, buf, place); + matchBuf[place] = (char) NULL; tmp = matchBuf; /* skip any leading white space */