aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mazerator.c11
-rw-r--r--src/utils.c2
2 files changed, 11 insertions, 2 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);
diff --git a/src/utils.c b/src/utils.c
index 69ce55d..da48ef6 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -33,7 +33,7 @@ unsigned int str_to_uint(char *str, char **err)
{
if (*str == '-')
{
- *err = "Not greater than 0";
+ *err = "Less than 0";
return 0;
}