diff -u nano/files.c nano-hist/files.c --- nano/files.c Sun Feb 2 23:15:37 2003 +++ nano-hist/files.c Sun Feb 2 23:27:06 2003 @@ -2933,7 +2933,7 @@ chmod(nanohist, S_IRUSR | S_IWUSR); /* write oldest first */ for (h = search_history.tail ; h->prev ; h = h->prev) { - h->data = nrealloc(h->data, strlen(h->data) + 1); + h->data = nrealloc(h->data, strlen(h->data) + 2); strcat(h->data, "\n"); if (fputs(h->data, hist) == EOF) { rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno)); @@ -2945,7 +2945,7 @@ goto come_from; } for (h = replace_history.tail ; h->prev ; h = h->prev) { - h->data = nrealloc(h->data, strlen(h->data) + 1); + h->data = nrealloc(h->data, strlen(h->data) + 2); strcat(h->data, "\n"); if (fputs(h->data, hist) == EOF) { rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));