Bugfix: Correct handling of n in strncat()
This commit is contained in:
@@ -144,7 +144,7 @@ void set_speech_string(jolly_t *jolly, char announcement, const char *number)
|
|||||||
{
|
{
|
||||||
jolly->speech_string[0] = announcement;
|
jolly->speech_string[0] = announcement;
|
||||||
jolly->speech_string[1] = '\0';
|
jolly->speech_string[1] = '\0';
|
||||||
strncat(jolly->speech_string, number, sizeof(jolly->speech_string) - 1);
|
strncat(jolly->speech_string, number, sizeof(jolly->speech_string) - strlen(number) - 1);
|
||||||
jolly->speech_digit = 0;
|
jolly->speech_digit = 0;
|
||||||
jolly->speech_pos = 0;
|
jolly->speech_pos = 0;
|
||||||
}
|
}
|
||||||
|
@@ -636,7 +636,7 @@ int sdr_start(void *inst)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
pthread_getname_np(tid, tname, sizeof(tname));
|
pthread_getname_np(tid, tname, sizeof(tname));
|
||||||
strncat(tname, "-sdr_tx", sizeof(tname) - 1);
|
strncat(tname, "-sdr_tx", sizeof(tname) - 7 - 1);
|
||||||
tname[sizeof(tname) - 1] = '\0';
|
tname[sizeof(tname) - 1] = '\0';
|
||||||
pthread_setname_np(tid, tname);
|
pthread_setname_np(tid, tname);
|
||||||
sdr->thread_read.running = 1;
|
sdr->thread_read.running = 1;
|
||||||
@@ -648,7 +648,7 @@ int sdr_start(void *inst)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
pthread_getname_np(tid, tname, sizeof(tname));
|
pthread_getname_np(tid, tname, sizeof(tname));
|
||||||
strncat(tname, "-sdr_rx", sizeof(tname) - 1);
|
strncat(tname, "-sdr_rx", sizeof(tname) - 7 - 1);
|
||||||
tname[sizeof(tname) - 1] = '\0';
|
tname[sizeof(tname) - 1] = '\0';
|
||||||
pthread_setname_np(tid, tname);
|
pthread_setname_np(tid, tname);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user