Safety updates

This commit is contained in:
ehofman 2003-10-20 09:41:26 +00:00
parent a4535c92c3
commit 79d5bf66a7

View File

@ -17,8 +17,11 @@ namespace std {
ostringstream(const string &str, int=ios::out) { ostringstream(const string &str, int=ios::out) {
sstr = new ostrstream((char *)str.c_str(), str.size(), ios::out); sstr = new ostrstream((char *)str.c_str(), str.size(), ios::out);
} }
~ostringstream() { delete sstr; } ~ostringstream() { delete sstr->str(); delete sstr; }
std::string str() { return std::string(sstr->str()); } std::string str() {
std::string _str = std::string(sstr->str()); _str.append('\0');
return _str;
}
int pcount() { return sstr->pcount(); } int pcount() { return sstr->pcount(); }
}; };