0025740: VrmlData_Scene::WriteArrIndex() writes extra point indices.
[occt.git] / src / VrmlData / VrmlData_Scene.cxx
index 6c0c6d7..ff57177 100644 (file)
@@ -4,8 +4,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
@@ -42,6 +42,7 @@
 #include <TopExp_Explorer.hxx>
 #include <BRep_Builder.hxx>
 #include <Precision.hxx>
+#include <Standard_Version.hxx>
 
 #ifdef WNT
 #define _CRT_SECURE_NO_DEPRECATE
@@ -75,7 +76,8 @@ VrmlData_Scene::VrmlData_Scene
     myAutoNameCounter (0)
 {
   myWorldInfo = new VrmlData_WorldInfo (* this);
-  myWorldInfo->AddInfo ("Created by OPEN CASCADE (tm) VrmlData API");
+  Standard_CString anInfo = "Generated by Open CASCADE Technology " OCC_VERSION_STRING;
+  myWorldInfo->AddInfo (anInfo);
   myLstNodes.Append (myWorldInfo);
   myAllNodes.Append (myWorldInfo);
 }
@@ -185,7 +187,7 @@ void VrmlData_Scene::SetVrmlDir (const TCollection_ExtendedString& theDir)
 //purpose  : 
 //=======================================================================
 
-const Handle_VrmlData_WorldInfo& VrmlData_Scene::WorldInfo() const
+const Handle(VrmlData_WorldInfo)& VrmlData_Scene::WorldInfo() const
 {
   return myWorldInfo;
 }
@@ -896,6 +898,8 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex
             char * ptr = &buf[0];
             for (Standard_Integer i = 0; i < nVal; i++) {
               Sprintf (ptr, "%d,", arrVal[i]);
+              if (i == nVal - 1)
+                break;
               ptr = strchr (ptr, ',') + 1;
               if ((ptr - &buf[0]) > (ptrdiff_t)aLineLimit) {
                 WriteLine(buf);