mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 02:34:00 +00:00
[common] option: fix invalid access of null/invalid options
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user