From bd98ff02f6ffee0191bed9bb9bde723889072783 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 1 Feb 2015 10:07:08 +0000 Subject: [PATCH] Avoiding to trim the nano version number on the status bar. Patch by Kamil Dudka. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/files.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f6641605..ccf5216c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * src/files.c (do_lockfile): Avoid printing a wrong PID on the status bar due to treating serialized PID bytes as signed integers. This addresses https://bugzilla.redhat.com/1186384 reported by Don Swaner. + * src/files.c (write_lockfile): Do not trim the nano version number + -- snprintf() counts the trailing zero into the size limit. 2015-02-01 Benno Schulenberg * src/winio.c (do_credits): Add a general entry for all translators. diff --git a/src/files.c b/src/files.c index 43b8c13d..20d16dc7 100644 --- a/src/files.c +++ b/src/files.c @@ -200,7 +200,7 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi lockdata[1] = 0x30; lockdata[24] = mypid % 256; lockdata[25] = mypid / 256; - snprintf(&lockdata[2], 10, "nano %s", VERSION); + snprintf(&lockdata[2], 11, "nano %s", VERSION); strncpy(&lockdata[28], mypwuid->pw_name, 16); strncpy(&lockdata[68], myhostname, 31); strncpy(&lockdata[108], origfilename, 768);