1
0
mirror of https://passt.top/passt synced 2024-10-01 03:25:48 +00:00

qrap: Silence gcc -O3 warning about strncpy() buffer length

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-05-21 11:14:49 +02:00
parent 4adae47c40
commit af243857fa

2
qrap.c
View File

@ -109,7 +109,7 @@ int main(int argc, char **argv)
if (argc >= 3) {
fd = strtol(argv[1], NULL, 0);
if (fd >= 3 && fd < INT_MAX && !errno) {
char env_path[ARG_MAX], *p, command[ARG_MAX];
char env_path[ARG_MAX + 1], *p, command[ARG_MAX];
strncpy(env_path, getenv("PATH"), ARG_MAX);
p = strtok(env_path, ":");