From 28977700690825a236f158c45bd2c8bd4af2279c Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 13 Dec 2006 13:31:04 +0000 Subject: [PATCH] Fixed bug in method FindOrCreateAttribute, now AttributeTreeNode is correctly processed --- src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 05d9dec5e..e5ff80494 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -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); } -- 2.39.2