2
0
mirror of https://github.com/wolfpld/tracy synced 2026-01-19 04:52:09 +00:00

Check if pw_gecos is non-empty on Android

Ensure pw_gecos is not empty before returning.
This commit is contained in:
Kejin
2026-01-18 14:01:19 +08:00
committed by GitHub
parent 1cad2903a1
commit d6597b0bdd

View File

@@ -374,7 +374,7 @@ TRACY_API const char* GetUserFullName()
return nullptr;
#elif defined __ANDROID__
const auto passwd = getpwuid( getuid() );
if( passwd && passwd->pw_gecos ) return passwd->pw_gecos;
if( passwd && passwd->pw_gecos && *passwd->pw_gecos ) return passwd->pw_gecos;
return nullptr;
#else
static char buf[4*1024];