Fix bug in --save caused by failure to initialise ctx.error to zero
[sgt/puzzles] / gtk.c
diff --git a/gtk.c b/gtk.c
index 1af877c..e6a0366 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -2705,6 +2705,7 @@ int main(int argc, char **argv)
                    return 1;
                }
                sfree(realname);
+                ctx.error = 0;
                midend_serialise(me, savefile_write, &ctx);
                if (ctx.error) {
                    fprintf(stderr, "%s: write: %s\n", realname,