Check for invalid puzzle file added
[wordblah.git] / wordblah.c
index 2dbc366..db5c605 100644 (file)
@@ -340,6 +340,12 @@ void do_open_puzzle (const char *filename)
        }
 
        p = load_puzzle (filename);
+       if (p.grid_size == 0)
+       {
+               printf (INVALID_PUZZLE);
+               char ch = getchar ();
+               return;
+       }
        
        if (strcmp (p.hashed_master_password, "\0") != 0)
        {