diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index 19bf101a..5c340343 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -84,7 +84,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, if (mThandle) { // set thread name char lname[16]; - int len = sizeof(lname) - 1; + int len = (sizeof(lname)>sizeof(threadName)) ? + (sizeof(threadName) -1):(sizeof(lname) - 1); memcpy(lname, threadName, len); lname[len] = 0; // set the thread name here