From e0485033ec25c85f95129266dc9e3735b283abc7 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jan 15 2019 19:40:39 +0000 Subject: Fix compiler warning in snmp main() Reviewed by: mreynolds(one line commit rule) --- diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index 1e64705..ccfb9b8 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -295,7 +295,7 @@ load_config(char *conf_path) /* set pidfile path */ if ((pidfile = malloc(strlen(LOCALSTATEDIR) + strlen("/run/") + strlen(LDAP_AGENT_PIDFILE) + 1)) != NULL) { - strncpy(pidfile, LOCALSTATEDIR, strlen(LOCALSTATEDIR)); + strncpy(pidfile, LOCALSTATEDIR, strlen(LOCALSTATEDIR) + 1); /* The above will likely not be NULL terminated, but we need to * be sure that we're properly NULL terminated for the below * strcat() to work properly. */