Use convert instead of a stream to read LFUN_REPEAT count

At least coverity should find it safer.
This commit is contained in:
Jean-Marc Lasgouttes 2017-03-28 11:02:21 +02:00
parent f58d7dfe7b
commit 5c03cb340c

View File

@ -1857,10 +1857,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// repeat command
string countstr;
string rest = split(argument, countstr, ' ');
istringstream is(countstr);
int count = 0;
is >> count;
//lyxerr << "repeat: count: " << count << " cmd: " << rest << endl;
int const count = convert<int>(countstr);
for (int i = 0; i < count; ++i)
dispatch(lyxaction.lookupFunc(rest));
break;