summaryrefslogtreecommitdiff
path: root/utils/LocThread.cpp
diff options
context:
space:
mode:
authorBhavna Sharma <sbhavna@codeaurora.org>2019-01-04 17:13:21 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-01-04 17:21:48 -0800
commit2332db20a984a1f49b31be3bf320aaa448b40b8d (patch)
tree63522d4fa965062eadac81eef86eb1f62cbc7e87 /utils/LocThread.cpp
parent3203504a28c72cf9823f1864b46b8692cf7979ec (diff)
downloadgps-2332db20a984a1f49b31be3bf320aaa448b40b8d.tar.gz
Fix issue with setting of thread name
Only first 3 chars of thread name were getting set because of incorrect length check. This change fixes the issue. CRs-Fixed: 2376235 Change-Id: Iba4ad44af2e3bfde8da8ae4efdd4b132299ae9b7
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