diff --git a/gps/utils/LocThread.cpp b/gps/utils/LocThread.cpp index 19bf101..a7fd1c8 100644 --- a/gps/utils/LocThread.cpp +++ b/gps/utils/LocThread.cpp @@ -84,9 +84,7 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, if (mThandle) { // set thread name char lname[16]; - int len = sizeof(lname) - 1; - memcpy(lname, threadName, len); - lname[len] = 0; + strlcpy(lname, threadName, sizeof(lname)); // set the thread name here pthread_setname_np(mThandle, lname);