From: ehofman Date: Mon, 20 Oct 2003 09:41:26 +0000 (+0000) Subject: Safety updates X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=79d5bf66a760737514e12824afbf8cc6995c5cc2;p=simgear.git Safety updates --- diff --git a/simgear/compatibility/sstream b/simgear/compatibility/sstream index 5d023eac..cf6ac678 100644 --- a/simgear/compatibility/sstream +++ b/simgear/compatibility/sstream @@ -17,8 +17,11 @@ namespace std { ostringstream(const string &str, int=ios::out) { sstr = new ostrstream((char *)str.c_str(), str.size(), ios::out); } - ~ostringstream() { delete sstr; } - std::string str() { return std::string(sstr->str()); } + ~ostringstream() { delete sstr->str(); delete sstr; } + std::string str() { + std::string _str = std::string(sstr->str()); _str.append('\0'); + return _str; + } int pcount() { return sstr->pcount(); } };