From 61aef3ce0551b672f9ed471b02cc47d1d4deb32f Mon Sep 17 00:00:00 2001 From: szy Date: Mon, 10 Jun 2019 12:59:39 +0300 Subject: [PATCH] 0030772: Data Exchange - Invalid person's name constructed by STEPConstruct_AP203Context class. // fixed remarks. --- src/STEPConstruct/STEPConstruct_AP203Context.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/STEPConstruct/STEPConstruct_AP203Context.cxx b/src/STEPConstruct/STEPConstruct_AP203Context.cxx index 54e2ca9066..a5cae628cd 100644 --- a/src/STEPConstruct/STEPConstruct_AP203Context.cxx +++ b/src/STEPConstruct/STEPConstruct_AP203Context.cxx @@ -179,15 +179,14 @@ Handle(StepBasic_PersonAndOrganization) STEPConstruct_AP203Context::DefaultPerso // construct person`s name OSD_Process sys; - Standard_CString usr = sys.UserName().ToCString(); -#if !defined(_WIN32) && !defined(__ANDROID__) - if ( usr ) { - struct passwd *pwd = getpwnam ( usr ); - if ( pwd ) usr = pwd->pw_gecos; + TCollection_AsciiString user (sys.UserName()); +#if !defined(_WIN32) && !defined(__ANDROID__) + if ( !user.IsEmpty() ) { + struct passwd *pwd = getpwnam ( user.ToCString() ); + if ( pwd ) user = pwd->pw_gecos; } - else usr = "Unknown"; + else user = "Unknown"; #endif - TCollection_AsciiString user ( usr ); Handle(TCollection_HAsciiString) fname = new TCollection_HAsciiString (""); Handle(TCollection_HAsciiString) lname = new TCollection_HAsciiString (""); Handle(Interface_HArray1OfHAsciiString) mname;