summaryrefslogtreecommitdiff
path: root/fuzz.c
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2018-01-09 20:06:58 +0100
committerRobert Swiecki <robert@swiecki.net>2018-01-09 20:06:58 +0100
commitc4b067be83c0406f94412d49344b627d095e3dac (patch)
treebc76be52ff24c1588cbfbb31e5b7829e4d743e86 /fuzz.c
parent702ca7061652ed31a00eac28b327a010a6899c8a (diff)
downloadhonggfuzz-c4b067be83c0406f94412d49344b627d095e3dac.tar.gz
fuzz: correct version of pthread_setname_np
Diffstat (limited to 'fuzz.c')
-rw-r--r--fuzz.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fuzz.c b/fuzz.c
index 1a67d4c8..8daf0b78 100644
--- a/fuzz.c
+++ b/fuzz.c
@@ -632,8 +632,10 @@ static void* fuzz_threadNew(void* arg) {
unsigned int fuzzNo = ATOMIC_POST_INC(hfuzz->threads.threadsActiveCnt);
LOG_I("Launched new fuzzing thread, no. #%" PRId32, fuzzNo);
- if (pthread_setname_np(pthread_self(), "HFUZZ-%" PRId32) != 0) {
- PLOG_W("pthread_setname_np(pthread_self()) failed");
+ char tname[16];
+ snprintf(tname, sizeof(tname), "HFUZZ-%" PRId32, fuzzNo);
+ if (pthread_setname_np(pthread_self(), tname) != 0) {
+ PLOG_W("pthread_setname_np(pthread_self(), '%s') failed", tname);
}
run_t run = {