summaryrefslogtreecommitdiff
path: root/utils/LocThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/LocThread.cpp')
-rw-r--r--utils/LocThread.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp
index c1052cb..568a6bb 100644
--- a/utils/LocThread.cpp
+++ b/utils/LocThread.cpp
@@ -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