diff --git a/src/files.c b/src/files.c index 2c02cfa4a8e15aaf3a75e8d3976a797f623fa2c0..4e6d46c7ab6ef8ba312f0727513f6548373b9a61 100644 --- a/src/files.c +++ b/src/files.c @@ -402,7 +402,8 @@ char *get_next_filename(const char *name, const char *suffix) sprintf(buf + namelen + suffixlen, ".%lu", i); } - /* We get here only if there is no possible save file. */ + /* We get here only if there is no possible save file. Blank out + * the filename to indicate this. */ null_at(&buf, 0); return buf; diff --git a/src/nano.c b/src/nano.c index fc823078d27747f09fae34705efc321d07cfb443..d10f0031039f9046ffa47954164c25221629a772 100644 --- a/src/nano.c +++ b/src/nano.c @@ -175,8 +175,11 @@ void die_save_file(const char *die_filename) if (!failed) fprintf(stderr, _("\nBuffer written to %s\n"), retval); - else + else if (retval[0] != '\0') fprintf(stderr, _("\nBuffer not written to %s: %s\n"), retval, + strerror(errno)); + else + fprintf(stderr, _("\nBuffer not written: %s\n"), _("Too many backup files?")); free(retval);