Chomp newline from end of thread string.

This commit is contained in:
Bartosz Taudul 2019-07-03 16:12:14 +02:00
parent d664b93ae0
commit 94b470ba66

View File

@ -180,8 +180,14 @@ const char* GetThreadName( uint64_t id )
# endif
if ( ( fd = open( path, O_RDONLY ) ) > 0) {
int len = read( fd, buf, 255 );
if ( len > 0 )
if( len > 0 )
{
buf[len] = 0;
if( len > 1 && buf[len-1] == '\n' )
{
buf[len-1] = 0;
}
}
close( fd );
}
# ifndef __ANDROID__