From a645f2a50a4b44444a5da87dc62c0cc743469f9d Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sun, 28 Jan 2018 03:16:54 +0000 Subject: [PATCH] Revert r328492: "Fix gcc80 -Wsizeof-pointer-memaccess warning." The warning is bogus: GCC8 only looks at the size of the destination. We shouldn't be fixing imaginary problems, so perhaps its better to deal with this later on by disabling such warnings. Pointed out by: ed, bde --- contrib/opie/libopie/insecure.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/opie/libopie/insecure.c b/contrib/opie/libopie/insecure.c index 13d56993a7e3..ba2a9dfaeb5a 100644 --- a/contrib/opie/libopie/insecure.c +++ b/contrib/opie/libopie/insecure.c @@ -135,7 +135,8 @@ int opieinsecure FUNCTION_NOARGS char host[sizeof(utmp.ut_host) + 1]; insecure = 1; - strncpy(host, utmp.ut_host, sizeof(host)); + strncpy(host, utmp.ut_host, sizeof(utmp.ut_host)); + host[sizeof(utmp.ut_host)] = 0; if (s = strchr(host, ':')) { int n = s - host;