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.
This commit is contained in:
Josef Söntgen 2013-05-21 11:34:35 +02:00 committed by Norman Feske
parent 29b8370f73
commit dad3f32d0b

View File

@ -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);
}