"\n"
"Positional arguments:\n"
"\tFILE zero or one sokoban screens\n"
- "\t when no file is specified stdin will be used\n", prg);
+ "\t when no file is specified stdin will be used\n", prg);
}
BDD subsolve(trans_t *t, BDD new){
} else {
DPRINT("Processing: %s\n", argv[optind]);
FILE *currentfile = fopen(argv[optind], "r");
+ if(currentfile == NULL){
+ printf("File could not be opened\n");
+ return 2;
+ }
DPRINT("Opening file\n");
return solve(currentfile, lurd);
DPRINT("Closing file\n");
x++;
}
}
+ if(safe == true && boxes == 0){
+ fprintf(stderr,
+ "Invalid screen. You need at least 1 box\n");
+ exit(1);
+ }
if(safe == true && boxes != targets){
fprintf(stderr,
"Invalid screen. Boxes: %d, Targets: %d\n", boxes, targets);