Fix compiler warning in conjunction with strncpy

This commit is contained in:
Andreas Eversberg
2018-05-20 11:35:06 +02:00
parent 3438402fe2
commit 4e2ad7dae1
6 changed files with 11 additions and 11 deletions

View File

@@ -562,7 +562,7 @@ int sdr_start(void *inst)
return rc;
}
pthread_getname_np(tid, tname, sizeof(tname));
strncat(tname, "-sdr_tx", sizeof(tname));
strncat(tname, "-sdr_tx", sizeof(tname) - 1);
tname[sizeof(tname) - 1] = '\0';
pthread_setname_np(tid, tname);
sdr->thread_read.running = 1;
@@ -574,7 +574,7 @@ int sdr_start(void *inst)
return rc;
}
pthread_getname_np(tid, tname, sizeof(tname));
strncat(tname, "-sdr_rx", sizeof(tname));
strncat(tname, "-sdr_rx", sizeof(tname) - 1);
tname[sizeof(tname) - 1] = '\0';
pthread_setname_np(tid, tname);
}