From dad3f32d0b26d02acb3dff21a977b6f8d278ab28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Tue, 21 May 2013 11:34:35 +0200 Subject: [PATCH] linux: thread name wrongly truncated by one byte The terminating NUL char was not considerd in the calculation of the space needed for storing the string. Fixes #790. --- base-linux/src/core/platform_thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-linux/src/core/platform_thread.cc b/base-linux/src/core/platform_thread.cc index c159897d1..42767873b 100644 --- a/base-linux/src/core/platform_thread.cc +++ b/base-linux/src/core/platform_thread.cc @@ -77,7 +77,7 @@ Platform_thread::Registry *Platform_thread::_registry() Platform_thread::Platform_thread(const char *name, unsigned, addr_t) : _tid(-1), _pid(-1) { - strncpy(_name, name, min(sizeof(_name), strlen(name))); + strncpy(_name, name, min(sizeof(_name), strlen(name) + 1)); _registry()->insert(this); }