BUG: Result from ostrstream::str() can be a null pointer.

This commit is contained in:
Brad King 2002-06-25 09:18:43 -04:00
parent eb5b8e3d24
commit dae99c659d

View File

@ -181,7 +181,8 @@ public:
cmStrStreamCleanup cleanup(*this); cmStrStreamCleanup cleanup(*this);
cmStrStreamCleanup::IgnoreUnusedVariable(cleanup); cmStrStreamCleanup::IgnoreUnusedVariable(cleanup);
int pcount = this->pcount(); int pcount = this->pcount();
return std::string(this->Superclass::str(), pcount); const char* ptr = this->Superclass::str();
return std::string(ptr?ptr:"", pcount);
} }
private: private:
cmStringStream(const cmStringStream&); cmStringStream(const cmStringStream&);