X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/dafd6cf6826f9bbd27ddd780fab48221d4706556..9cfc03b7245f89f9ded8f844e55aebe0a74c7500:/gtk.c?ds=sidebyside diff --git a/gtk.c b/gtk.c index 6fef7b8..b72752a 100644 --- a/gtk.c +++ b/gtk.c @@ -1447,8 +1447,9 @@ static frontend *new_window(char *arg, char **error) " nor a save file (%.400s)", err, strerror(errno)); } else { err = midend_deserialise(fe->me, savefile_read, fp); - sprintf(errbuf, "%.800s", err); - fclose(fp); + if (err) + sprintf(errbuf, "%.800s", err); + fclose(fp); } } if (*errbuf) {