]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fixed bug with invalid last characters
authorsrn <srn@opencascade.com>
Tue, 22 Mar 2005 13:06:22 +0000 (13:06 +0000)
committersrn <srn@opencascade.com>
Tue, 22 Mar 2005 13:06:22 +0000 (13:06 +0000)
src/VISU_I/VISU_DumpPython.cc

index 0b5fd9f8249a418c58fbd8f91d883ed4847b4f48..6fae6944cd6ff93158435247356b95523da4f112 100644 (file)
@@ -1181,7 +1181,11 @@ namespace VISU{
     std::string aResult = aStr.str();
     ofstream anFStream("/tmp/dump.py");
     anFStream<<aResult<<endl;
-    return new Engines::TMPFile(aResult.size(),aResult.size(),(CORBA::Octet*)&aResult[0]);
+
+    char* aBuffer = new char[aResult.size()+1];
+    strcpy(aBuffer, (char*)&aResult[0]);
+
+    return new Engines::TMPFile(aResult.size()+1, aResult.size()+1, (CORBA::Octet*)aBuffer, 1); 
 #else
 #undef aStr
     return new Engines::TMPFile(0);