mode on. (DLR; found by David Benbennick)
save_history()
- Fix nrealloc return value being ignored (David Benbennick).
+ - Fix off-by-one bug causing write to unallocated memory
+ (David Benbennick).
- global.c:
thanks_for_all_the_fish()
- Fix compiling with DEBUG and multibuffer (David Benbennick).
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));
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));