Reduced risk during low memory conditions of error message handling

git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/class@4185 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2010-03-23 21:20:51 +00:00
parent 14e1791753
commit 5249f4be2a

View File

@ -832,19 +832,12 @@ int IPhreeqc::output_handler(const int type, const char *err_str, const int stop
case OUTPUT_ERROR:
if (this)
{
this->AddError("ERROR: ");
this->AddError(err_str);
this->AddError("\n");
if (stop == STOP)
{
static std::string str(200, ' ');
static std::ostringstream oss(str);
oss << "ERROR: " << err_str << "\n";
oss << "Stopping.\n";
this->AddError(oss.str().c_str());
}
else
{
std::ostringstream oss;
oss << "ERROR: " << err_str << "\n";
this->AddError(oss.str().c_str());
this->AddError("Stopping.\n");
}
}
break;