mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 19:40:12 +01:00
cli: handle NULL gracefully in nmc_arg_is_help()
This commit is contained in:
parent
4950abfb87
commit
d3ea9ee472
1 changed files with 2 additions and 0 deletions
|
|
@ -60,6 +60,8 @@ next_arg (int *argc, char ***argv)
|
|||
gboolean
|
||||
nmc_arg_is_help (const char *arg)
|
||||
{
|
||||
if (!arg)
|
||||
return FALSE;
|
||||
if ( matches (arg, "help") == 0
|
||||
|| (g_str_has_prefix (arg, "-") && matches (arg+1, "help") == 0)
|
||||
|| (g_str_has_prefix (arg, "--") && matches (arg+2, "help") == 0)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue