* src/browser.c (do_browser, browser_refresh): Rebuild the file list
only when necessary, not for each and every cursor movement. This
fixes Savannah bug #47133.
+ * src/files.c (save_poshistory): Allocate enough space for printing
+ out the line and column numbers. This fixes Savannah bug #47135.
GNU nano 2.5.2 - 2016.02.12
chmod(poshist, S_IRUSR | S_IWUSR);
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
- statusstr = charalloc(strlen(posptr->filename) + 2 * sizeof(ssize_t) + 4);
+ /* Assume 20 decimal positions each for line and column number,
+ * plus two spaces, plus the line feed, plus the null byte. */
+ statusstr = charalloc(strlen(posptr->filename) + 44);
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
(long)posptr->xno);
if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr))