diff options
author | Bhavna Sharma <sbhavna@codeaurora.org> | 2019-01-04 17:13:21 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-04 17:21:48 -0800 |
commit | 2332db20a984a1f49b31be3bf320aaa448b40b8d (patch) | |
tree | 63522d4fa965062eadac81eef86eb1f62cbc7e87 /utils/LocThread.cpp | |
parent | 3203504a28c72cf9823f1864b46b8692cf7979ec (diff) | |
download | gps-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.cpp | 4 |
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 |