]> git.wh0rd.org Git - nano.git/commitdiff
- files.c:save_history() - Fix nrealloc return value being ignored (David Benbennick)
authorChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 19:36:08 +0000 (19:36 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 19:36:08 +0000 (19:36 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1395 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
files.c

index adf50d6db7c76f7a3fe102fe073a0e250b5e664f..eeab326dbafee1d02240c00e8ff0eaf4555eef70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@ CVS Code -
 - files.c:
   open_file()
        - Fix FD leak with file load error (David Benbennick).
+  save_history()
+       - Fix nrealloc return value being ignored (David Benbennick).
 - nano.c:
   do_preserve_msg():
        - Unsplit error message into a single fprintf call (Jordi).
diff --git a/files.c b/files.c
index 75698f6e16e8e621bf49fe4fff0a03b4127e6d84..e6225a4113a39a805fe6ca4cc1cc9f2f83ab9d14 100644 (file)
--- a/files.c
+++ b/files.c
@@ -2925,7 +2925,7 @@ void save_history(void)
            chmod(nanohist, S_IRUSR | S_IWUSR);
            /* write oldest first */
            for (h = search_history.tail ; h->prev ; h = h->prev) {
-               nrealloc(h->data, strlen(h->data) + 1);
+               h->data = nrealloc(h->data, strlen(h->data) + 1);
                strcat(h->data, "\n");
                if (fputs(h->data, hist) == EOF) {
                    rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
@@ -2937,7 +2937,7 @@ void save_history(void)
                    goto come_from;
            }
            for (h = replace_history.tail ; h->prev ; h = h->prev) {
-               nrealloc(h->data, strlen(h->data) + 1);
+               h->data = nrealloc(h->data, strlen(h->data) + 1);
                strcat(h->data, "\n");
                if (fputs(h->data, hist) == EOF) {
                    rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));