]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fixed bug in method FindOrCreateAttribute, now AttributeTreeNode is correctly processed
authorsrn <srn@opencascade.com>
Wed, 13 Dec 2006 13:31:04 +0000 (13:31 +0000)
committersrn <srn@opencascade.com>
Wed, 13 Dec 2006 13:31:04 +0000 (13:31 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx

index 05d9dec5e8378a2f93a19adc0eb54a459c6b03ad..e5ff80494c7aac9254606051b55026cbe1411fd5 100644 (file)
@@ -482,7 +482,11 @@ Handle(TDF_Attribute) SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const Han
     } else {
       char* aGUIDString = new char[40];
       char* aType = (char*)aTypeOfAttribute.ToCString();
-      sprintf(aGUIDString, &(aType[21]));
+      sprintf(aGUIDString, &(aType[17]));
+      if(!Standard_GUID::CheckGUIDFormat(aGUIDString)) {
+        delete(aGUIDString);
+        return NULL;      
+      }
       aTreeNodeGUID = Standard_GUID(aGUIDString); // create tree node GUID by name
       delete(aGUIDString);
     }