Fix usage of strncat
This commit is contained in:
@@ -467,7 +467,7 @@ static void *device_child(void *arg)
|
|||||||
const char *dev_info_argv[] = { dev_name };
|
const char *dev_info_argv[] = { dev_name };
|
||||||
struct cuse_info ci;
|
struct cuse_info ci;
|
||||||
|
|
||||||
strncat(dev_name, device->name, sizeof(dev_name) - strlen(device->name) - 1);
|
strncat(dev_name, device->name, sizeof(dev_name) - strlen(dev_name) - 1);
|
||||||
|
|
||||||
memset(&ci, 0, sizeof(ci));
|
memset(&ci, 0, sizeof(ci));
|
||||||
ci.dev_major = device->major;
|
ci.dev_major = device->major;
|
||||||
@@ -520,7 +520,7 @@ void *device_init(void *inst, const char *name, int (*open)(void *inst, int flag
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_getname_np(device->thread, tname, sizeof(tname));
|
pthread_getname_np(device->thread, tname, sizeof(tname));
|
||||||
strncat(tname, "-device", sizeof(tname) - 7 - 1);
|
strncat(tname, "-device", sizeof(tname) - strlen(tname) - 1);
|
||||||
tname[sizeof(tname) - 1] = '\0';
|
tname[sizeof(tname) - 1] = '\0';
|
||||||
pthread_setname_np(device->thread, tname);
|
pthread_setname_np(device->thread, tname);
|
||||||
|
|
||||||
|
@@ -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) - strlen(number) - 1);
|
strncat(jolly->speech_string, number, sizeof(jolly->speech_string) - strlen(jolly->speech_string) - 1);
|
||||||
jolly->speech_digit = 0;
|
jolly->speech_digit = 0;
|
||||||
jolly->speech_pos = 0;
|
jolly->speech_pos = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user