tools: Fix handling of empty argv in various minor GLib tools

This won’t really affect anything, but we might as well fix them to not
crash if called with an empty `argv` by someone (ab)using `execve()`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall
2022-01-31 14:47:57 +00:00
parent 0d743e7ffb
commit 3ea4ba31a1
5 changed files with 8 additions and 5 deletions

View File

@@ -196,7 +196,7 @@ main (gint argc,
}
if (!gen_froots && !gen_tree)
return help (argv[i-1]);
return help ((argc > 0) ? argv[i-1] : NULL);
if (!indent_inc)
{