diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 845d96032bc0..cc335a8abde9 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -383,7 +383,7 @@ main (int argc, char **argv) pid_file[0] = '\0'; snprintf(pidfile_temp, sizeof(pidfile_temp), "%s/ospfd-%d.pid", pid_file, instance ); - strncpy(pid_file, pidfile_temp, sizeof(pid_file)); + strlcpy(pid_file, pidfile_temp, sizeof(pid_file)); } /* Process id file create. */ pid_output (pid_file);