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