Merge "Fix issue with setting of thread name"

This commit is contained in:
qctecmdr Service 2019-01-08 13:09:18 -08:00 committed by Gerrit - the friendly Code Review server
commit 63dca90436

View file

@ -85,8 +85,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
if (mThandle) {
// set thread name
char lname[16];
int len = (sizeof(lname)>sizeof(threadName)) ?
(sizeof(threadName) -1):(sizeof(lname) - 1);
int len = (sizeof(lname) > (strlen(threadName) + 1)) ?
(strlen(threadName)):(sizeof(lname) - 1);
memcpy(lname, threadName, len);
lname[len] = 0;
// set the thread name here