Initialize client's name in main()

Initializing clientName at declaration time is not a good idea.

Spotted by Coverity scan.
This commit is contained in:
Jean-Marc Lasgouttes 2024-09-09 15:29:39 +02:00
parent 12d771c43f
commit 3d323412ad

View File

@ -460,8 +460,7 @@ int h(vector<docstring> const &)
}
docstring clientName =
from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
docstring clientName;
int n(vector<docstring> const & arg)
{
@ -710,9 +709,12 @@ int LyXClientApp::run()
int main(int argc, char * argv[])
{
lyx::lyxerr.setStream(cerr);
using namespace lyx;
lyxerr.setStream(cerr);
cmdline::clientName =
from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
lyx::LyXClientApp app(argc, argv);
LyXClientApp app(argc, argv);
return app.exec();
}