qrap: Silence gcc -O3 warning about strncpy() buffer length
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
4adae47c40
commit
af243857fa
1 changed files with 1 additions and 1 deletions
2
qrap.c
2
qrap.c
|
@ -109,7 +109,7 @@ int main(int argc, char **argv)
|
||||||
if (argc >= 3) {
|
if (argc >= 3) {
|
||||||
fd = strtol(argv[1], NULL, 0);
|
fd = strtol(argv[1], NULL, 0);
|
||||||
if (fd >= 3 && fd < INT_MAX && !errno) {
|
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);
|
strncpy(env_path, getenv("PATH"), ARG_MAX);
|
||||||
p = strtok(env_path, ":");
|
p = strtok(env_path, ":");
|
||||||
|
|
Loading…
Reference in a new issue