mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[common] option: fix invalid access of null/invalid options
This commit is contained in:
parent
2d5f6d65ce
commit
06c229dfd4
@ -267,15 +267,14 @@ bool option_parse(int argc, char * argv[])
|
||||
if (state.options[i]->shortopt == argv[a][1])
|
||||
{
|
||||
o = state.options[i];
|
||||
if (o->type != OPTION_TYPE_BOOL && a < argc - 1)
|
||||
{
|
||||
++a;
|
||||
value = strdup(argv[a]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (o->type != OPTION_TYPE_BOOL && a < argc - 1)
|
||||
{
|
||||
++a;
|
||||
value = strdup(argv[a]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user