From cbb0f8bde244322791b79e9af538f5b5bdd28739 Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Wed, 15 Nov 2000 03:50:02 +0000
Subject: [PATCH] -pedantic fixes by Rocco Corsi

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  5 +++--
 po/nano.pot |  2 +-
 search.c    | 10 ++++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 21f57e01..0beeafae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,8 +12,9 @@ CVS Code -
 	  function mallocstrcpy which is sure to be a programmatic
 	  nightmare, changed last_search, last_replace, answer to
 	  pointers.  New function not_found_msg in search.c for displaying
-	  truncated strings in satusbar when the string is not found.
-	  We disable this feature when using PICO_MSGS (-p).
+	  truncated strings in satusbar when the string is not found
+	  (-pedantic fixes by Rocco Corsi). We disable this feature when
+	  using PICO_MSGS (-p).
 	- New spelling code by Rocco Corsi.  New functions
 	  do_int_speller, do_alt_speller, changes to do_spell in nano.c,
 	  New functions search_init_globals and do_replace_loop, changes
diff --git a/po/nano.pot b/po/nano.pot
index 4e3d31a9..429ac2de 100644
--- a/po/nano.pot
+++ b/po/nano.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-11-14 20:24-0500\n"
+"POT-Creation-Date: 2000-11-14 20:33-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/search.c b/search.c
index 569e0637..df58fc40 100644
--- a/search.c
+++ b/search.c
@@ -158,14 +158,16 @@ int search_init(int replacing)
 
 void not_found_msg(char *str)
 {
-    char foo[COLS];
-
-    if (strlen(str) < COLS / 2)
+    if (strlen(str) <= COLS / 2)
 	statusbar(_("\"%s\" not found"), str);
     else {
-	strncpy(foo, str, COLS / 2);
+	char *foo = NULL;
+
+	foo = mallocstrcpy(foo, str);
 	foo[COLS / 2] = 0;
 	statusbar(_("\"%s...\" not found"), foo);
+
+	free(foo);
     }
 }
 
-- 
GitLab