From 9e738dff3133bc64612f298dffd667fe30e0d19e Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 8 Nov 2018 13:01:15 -0500 Subject: __getpublickey_real: Removed a warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In function ‘__getpublickey_real.part.0’, inlined from ‘__getpublickey_real’: getpublickey.c:77:9: warning: ‘strncpy’ output may be truncated copying 47 bytes from a string of length 143 [-Wstringop-truncation] (void) strncpy(publickey, lookup, HEXKEYBYTES-1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson --- src/getpublickey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/getpublickey.c b/src/getpublickey.c index 8cf4dc2..be37a24 100644 --- a/src/getpublickey.c +++ b/src/getpublickey.c @@ -74,7 +74,7 @@ __getpublickey_real(netname, publickey) return (0); } *p = '\0'; - (void) strncpy(publickey, lookup, HEXKEYBYTES); + memcpy(publickey, lookup, HEXKEYBYTES); publickey[HEXKEYBYTES] = '\0'; return (1); } -- cgit v1.2.1