From 0744355a673e334a49ab53822ae019f74770e101 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 10 Jun 2020 12:21:58 +0200 Subject: [PATCH] Fix off-by-one (found by lispbub, #43). --- common/TracySystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;