nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 85307fe28ed548d6df876e59c0a2a670b205be51
parent 1755e28ad97bbc9e434fde84c1727fd153b97418
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue,  3 Oct 2006 18:46:00 +0000

in input_tab(), since the field precision operator used in the sprintf()
uses ints and not size_t's, replace it with two strncpy()s, which use
size_t's


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

Diffstat:
MChangeLog | 5+++++
Msrc/files.c | 7+++++--
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,4 +1,9 @@ CVS code - +- files.c: + input_tab() + - Since the field precision operator used in the sprintf() uses + ints and not size_t's, replace it with two strncpy()s, which + use size_t's. (DLR) - help.c: parse_help_input() - Add 'E' and 'e' as aliases for Exit, for consistency with the diff --git a/src/files.c b/src/files.c @@ -2239,8 +2239,11 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool free(match2_mb); mzero = charalloc(lastslash_len + common_len + 1); - sprintf(mzero, "%.*s%.*s", lastslash_len, buf, common_len, - matches[0]); + + /*sprintf(mzero, "%.*s%.*s", lastslash_len, buf, common_len, + matches[0]);*/ + strncpy(mzero, buf, lastslash_len); + strncpy(mzero + lastslash_len, matches[0], common_len); common_len += lastslash_len;