From f265a7c6c7b768128c8a47980ffaf79cf9a5b13a Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Wed, 19 Mar 2003 13:12:00 +0000 Subject: Fix parsing of the leases file. src & dst parameters to the only remaining strncpy() in the file were reversed. Use strlcpy() instead, with parameters in correct order. ok millert@. --- usr.sbin/dhcp/server/confpars.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/dhcp/server/confpars.c b/usr.sbin/dhcp/server/confpars.c index 4d69dd7580a..fec0c61d274 100644 --- a/usr.sbin/dhcp/server/confpars.c +++ b/usr.sbin/dhcp/server/confpars.c @@ -1179,8 +1179,7 @@ struct lease *parse_lease_declaration (cfile) parse_warn ("unexpected end of file"); break; } - strncpy (val, tbuf, sizeof tbuf); - tbuf [(sizeof tbuf) - 1] = 0; + strlcpy (tbuf, val, sizeof tbuf); /* Parse any of the times associated with the lease. */ if (token == STARTS || token == ENDS || token == TIMESTAMP) { -- cgit v1.2.3