diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index 309f7833..25ccf9f8 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -160,7 +160,7 @@ TRACY_API void SetThreadName( const char* name ) const auto sz = strlen( name ); char* buf = (char*)tracy_malloc( sz+1 ); memcpy( buf, name, sz ); - buf[sz+1] = '\0'; + buf[sz] = '\0'; auto data = (ThreadNameData*)tracy_malloc( sizeof( ThreadNameData ) ); data->id = detail::GetThreadHandleImpl(); data->name = buf;