]> git.mxchange.org Git - simgear.git/commitdiff
Safety updates
authorehofman <ehofman>
Mon, 20 Oct 2003 09:41:26 +0000 (09:41 +0000)
committerehofman <ehofman>
Mon, 20 Oct 2003 09:41:26 +0000 (09:41 +0000)
simgear/compatibility/sstream

index 5d023eac022b55d8c87b6d4c4098eecd880dd021..cf6ac678c0682722b335364dd66f8ab5ffd10eda 100644 (file)
@@ -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(); }
    };