commit cbb0f8bde244322791b79e9af538f5b5bdd28739
parent 2c9752291d9ccfc7baefbe6606607ec30ace68f5
Author: Chris Allegretta <chrisa@asty.org>
Date: Wed, 15 Nov 2000 03:50:02 +0000
-pedantic fixes by Rocco Corsi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git 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
@@ -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
@@ -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);
}
}