From: Jean-Marc Lasgouttes Date: Tue, 28 Mar 2017 09:02:21 +0000 (+0200) Subject: Use convert instead of a stream to read LFUN_REPEAT count X-Git-Tag: 2.3.0alpha1~162 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5c03cb340c2214a3142f254622b0efaaa654ec44;p=features.git Use convert instead of a stream to read LFUN_REPEAT count At least coverity should find it safer. --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 05b7a251cd..c27f4c87e3 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -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(countstr); for (int i = 0; i < count; ++i) dispatch(lyxaction.lookupFunc(rest)); break;