shithub: puzzles

Download patch

ref: d558bb240a07bae9799edcf0583b8fa2a0496d53
parent: 196695afdf4aaa33df5ac2ea66afe2e30a1ad140
author: Simon Tatham <anakin@pobox.com>
date: Tue Aug 23 08:49:21 EDT 2005

Don't report an error when loading a saved game from the command
line unless there really _is_ an error!

[originally from svn r6203]

--- a/gtk.c
+++ b/gtk.c
@@ -1447,8 +1447,9 @@
 			" 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) {