From: Chris Allegretta Date: Wed, 15 Nov 2000 03:50:02 +0000 (+0000) Subject: -pedantic fixes by Rocco Corsi X-Git-Tag: v0.9.20~12 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=cbb0f8bde244322791b79e9af538f5b5bdd28739;p=nano.git -pedantic fixes by Rocco Corsi git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- 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 \n" "Language-Team: LANGUAGE \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); } }