Initialize correctly SystemcallPrivate in constructor

It seems that Error is the best possibility when nothing has been done yet.

Found by Coverity
This commit is contained in:
Jean-Marc Lasgouttes 2016-06-09 17:34:14 +02:00
parent 7800c05788
commit 664fca5566

View File

@ -295,16 +295,10 @@ int Systemcall::startscript(Starttype how, string const & what,
} }
SystemcallPrivate::SystemcallPrivate(std::string const & sf, SystemcallPrivate::SystemcallPrivate(std::string const & sf, std::string const & of,
std::string const & of, std::string const & ef)
std::string const & ef) : : state(Error), process_(new QProcess), out_index_(0), err_index_(0),
process_(new QProcess), in_file_(sf), out_file_(of), err_file_(ef), process_events_(false)
out_index_(0),
err_index_(0),
in_file_(sf),
out_file_(of),
err_file_(ef),
process_events_(false)
{ {
if (!in_file_.empty()) if (!in_file_.empty())
process_->setStandardInputFile(QString::fromLocal8Bit(in_file_.c_str())); process_->setStandardInputFile(QString::fromLocal8Bit(in_file_.c_str()));