aboutsummaryrefslogtreecommitdiff
path: root/src/mazerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mazerator.c')
-rw-r--r--src/mazerator.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mazerator.c b/src/mazerator.c
index 8224fb9..593d518 100644
--- a/src/mazerator.c
+++ b/src/mazerator.c
@@ -72,6 +72,9 @@ int main(int argc, char *argv[])
if (err != NULL)
optarg_error(arg, err);
+ if (maze_width == 0)
+ optarg_error(arg, "It should not be 0");
+
break;
case 'h':
maze_height = str_to_uint(optarg, &err);
@@ -79,6 +82,9 @@ int main(int argc, char *argv[])
if (err != NULL)
optarg_error(arg, err);
+ if (maze_height == 0)
+ optarg_error(arg, "It should not be 0");
+
break;
case 'x':
start_x = malloc_s(sizeof(unsigned int *));
@@ -106,6 +112,9 @@ int main(int argc, char *argv[])
if (err != NULL)
optarg_error(arg, err);
+ if (*seed == 0)
+ optarg_error(arg, "It should not be 0");
+
break;
case 0:
printf("Usage: %s [OPTION]...\n\n"
@@ -119,7 +128,7 @@ int main(int argc, char *argv[])
" -W, --wall WALL Single character used as maze walls "
"(Default: '█')\n"
" -s, --seed SEED The randomization seed used for maze "
- "generation (Any number)\n"
+ "generation\n"
" --help Displays usage information\n",
argv[0]);
exit(0);