From 94b470ba66cb51bc8dc19fbe903489f6a3634aaa Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 3 Jul 2019 16:12:14 +0200 Subject: [PATCH] Chomp newline from end of thread string. --- common/TracySystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index 27297ea8..71f720ef 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -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__