mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Fix a very old UCI option parsing bug
We currently fail on an option with a sapece in the name, as example setoption name Clear Hash returns error message "Option Clear not found". This patch fixes this off-by-one type bug. Thanks to Joona for spotting this. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
cd1cc39b04
commit
aa5c375ca9
1 changed files with 6 additions and 4 deletions
|
@ -251,11 +251,13 @@ namespace {
|
||||||
if (token == "name")
|
if (token == "name")
|
||||||
{
|
{
|
||||||
uip >> name;
|
uip >> name;
|
||||||
uip >> token;
|
while (!uip.eof())
|
||||||
while (!uip.eof() && token != "value")
|
|
||||||
{
|
{
|
||||||
name += (" " + token);
|
|
||||||
uip >> token;
|
uip >> token;
|
||||||
|
if (token == "value")
|
||||||
|
break;
|
||||||
|
|
||||||
|
name += (" " + token);
|
||||||
}
|
}
|
||||||
if (token == "value")
|
if (token == "value")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue