Skip to content

Commit

Permalink
Report invalid search paths as "Invalid path" instead of "`Incomple…
Browse files Browse the repository at this point in the history
…te option`".
  • Loading branch information
redcode committed Aug 4, 2024
1 parent 294b192 commit 1008d12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sources/test-Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,14 @@ int main(int argc, char **argv)
zusize s;
char **p;

if (++i == argc || !(s = strlen(argv[i]))) goto incomplete_option;
if (++i == argc) goto incomplete_option;

if (!(s = strlen(argv[i])))
{
invalid = "path";
goto invalid_argument;
}

if (s > maximum_search_path_size) maximum_search_path_size = s;

if ((p = realloc(search_paths, (search_path_count + 1) * sizeof(char *))) == Z_NULL)
Expand Down

0 comments on commit 1008d12

Please sign in to comment.