mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-08 03:18:21 +00:00
Check for empty full name.
This commit is contained in:
@@ -365,13 +365,13 @@ TRACY_API const char* GetUserFullName()
|
||||
return nullptr;
|
||||
#elif defined __ANDROID__
|
||||
const auto passwd = getpwuid( getuid() );
|
||||
if( passwd ) return passwd->pw_gecos;
|
||||
if( passwd && *passwd->pw_gecos ) return passwd->pw_gecos;
|
||||
return nullptr;
|
||||
#else
|
||||
static char buf[4*1024];
|
||||
struct passwd pwd;
|
||||
struct passwd* ptr;
|
||||
if( getpwuid_r( getuid(), &pwd, buf, sizeof( buf ), &ptr ) == 0 && ptr == &pwd )
|
||||
if( getpwuid_r( getuid(), &pwd, buf, sizeof( buf ), &ptr ) == 0 && ptr == &pwd && *pwd.pw_gecos )
|
||||
{
|
||||
return pwd.pw_gecos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user