aboutsummaryrefslogtreecommitdiff
path: root/gps/utils/LocThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gps/utils/LocThread.cpp')
-rw-r--r--gps/utils/LocThread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/gps/utils/LocThread.cpp b/gps/utils/LocThread.cpp
index 19bf101..685841e 100644
--- a/gps/utils/LocThread.cpp
+++ b/gps/utils/LocThread.cpp
@@ -29,6 +29,7 @@
#include <LocThread.h>
#include <string.h>
#include <pthread.h>
+#include <platform_lib_macros.h>
class LocThreadDelegate {
LocRunnable* mRunnable;
@@ -84,7 +85,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