set_threadname: silence "overlapping src/dest" valgrind warning

This might be a false positive, but the fix does not harm ;)
This commit is contained in:
Stefan Seyfried
2016-01-03 18:41:52 +01:00
parent a4fbf4a614
commit b36c2b03d6

View File

@@ -7,7 +7,7 @@
inline void set_threadname(const char *name)
{
char threadname[17];
strncpy(threadname, name, sizeof(threadname));
strncpy(threadname, name, 16);
threadname[16] = 0;
prctl (PR_SET_NAME, (unsigned long)threadname);
}