Fix gcc80 -Wsizeof-pointer-memaccess warning.

Obtained from:	DragonFlyBSD (git 56267d362d5769c8df07bf26d5e322610e0d24b4)
This commit is contained in:
Pedro F. Giffuni 2018-01-27 22:16:19 +00:00
parent 1a4529b5e5
commit e28c47b570

View File

@ -135,8 +135,7 @@ int opieinsecure FUNCTION_NOARGS
char host[sizeof(utmp.ut_host) + 1];
insecure = 1;
strncpy(host, utmp.ut_host, sizeof(utmp.ut_host));
host[sizeof(utmp.ut_host)] = 0;
strncpy(host, utmp.ut_host, sizeof(host));
if (s = strchr(host, ':')) {
int n = s - host;