diff --git a/ChangeLog b/ChangeLog
index 4869071d232589797ba26157b91301254ea0761c..93b4a7e019091aa24ebf10cddd99e94bc521f1e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,9 @@ CVS code -
 	  when compiling with every option manually turned on, including
 	  NANO_SMALL. (David Benbennick)
 - files.c:
+  get_next_filename()
+	- Tweak for efficiency, and add the ".save" suffix to the file
+	  here. (David Benbennick)
   close_open_file()
 	- Tweak to no longer rely on the return values of
 	  open_(prev|next)file(). (DLR)
@@ -107,6 +110,11 @@ CVS code -
   thanks_for_all_the_fish()
 	- Delete topwin, edit, and bottomwin. (David Benbennick)
 - nano.c:
+  die()
+	- Don't add the ".save" suffix to a saved file here anymore, 
+	  since get_next_filename() does that now. (David Benbennick)
+  die_save_file()
+	- Tweak for efficiency. (David Benbennick)
   help_init()
 	- Fix the display of the translated key descriptions "Up" and
 	  "Space" under all circumstances, and make the help browser
diff --git a/src/files.c b/src/files.c
index a4246f02f06e7a99afb91e2627ee3e554a066655..59a54a96e009910b8d566bd26dbc97b910f4020c 100644
--- a/src/files.c
+++ b/src/files.c
@@ -394,19 +394,22 @@ bool open_file(const char *filename, int insert, int quiet)
 }
 
 /* This function will return the name of the first available extension
- * of a filename (starting with the filename, then filename.1, etc).
- * Memory is allocated for the return value.  If no writable extension
- * exists, we return "". */
+ * of a filename (starting with the filename.save, then filename.save.1,
+ * etc).  Memory is allocated for the return value.  If no writable
+ * extension exists, we return "". */
 char *get_next_filename(const char *name)
 {
     int i = 0;
-    char *buf = NULL;
-    struct stat fs;
+    char *buf;
+    size_t namelen = strlen(name);
 
-    buf = charalloc(strlen(name) + num_of_digits(INT_MAX) + 2);
+    buf = charalloc(namelen + num_of_digits(INT_MAX) + 7);
     strcpy(buf, name);
+    strcpy(buf + namelen, ".save");
+    namelen += 5;
 
     while (TRUE) {
+	struct stat fs;
 
 	if (stat(buf, &fs) == -1)
 	    return buf;
@@ -414,8 +417,7 @@ char *get_next_filename(const char *name)
 	    break;
 
 	i++;
-	strcpy(buf, name);
-	sprintf(&buf[strlen(name)], ".%d", i);
+	sprintf(buf + namelen, ".%d", i);
     }
 
     /* We get here only if there is no possible save file. */
diff --git a/src/nano.c b/src/nano.c
index 2d02fa0fd7598a1a7aa42d6099bdee7acbb0d667..0f5fce45ff71b9ecdec8fee53496f7922cca00e3 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -104,7 +104,7 @@ void finish(void)
     exit(0);
 }
 
-/* Die (gracefully?) */
+/* Die (gracefully?). */
 void die(const char *msg, ...)
 {
     va_list ap;
@@ -170,15 +170,9 @@ void die_save_file(const char *die_filename)
     /* If we can't save, we have REAL bad problems, but we might as well
        TRY. */
     if (die_filename[0] == '\0')
-	ret = get_next_filename("nano.save");
-    else {
-	char *buf = charalloc(strlen(die_filename) + 6);
+	die_filename = "nano";
 
-	strcpy(buf, die_filename);
-	strcat(buf, ".save");
-	ret = get_next_filename(buf);
-	free(buf);
-    }
+    ret = get_next_filename(die_filename);
     if (ret[0] != '\0')
 	failed = -1 == write_file(ret, TRUE, FALSE, TRUE);