Improve the algorithm for figuring out where the number should be
[sgt/puzzles] / magnets.c
index beeedf5..7af3d86 100644 (file)
--- a/magnets.c
+++ b/magnets.c
@@ -386,7 +386,7 @@ static char n2c(int num) { /* XXX cloned from singles.c */
 }
 
 static int c2n(char c) { /* XXX cloned from singles.c */
-    if (isdigit(c))
+    if (isdigit((unsigned char)c))
         return (int)(c - '0');
     else if (c >= 'a' && c <= 'z')
         return (int)(c - 'a' + 10);
@@ -2552,7 +2552,6 @@ int main(int argc, const char *argv[])
     err = validate_desc(p, desc);
     if (err) {
         fprintf(stderr, "%s: %s\nDescription: %s\n", quis, err, desc);
-        free_params(p);
         goto done;
     }
     s = new_game(NULL, p, desc);