From: Sebastian Pop Date: Tue, 22 Jan 2019 19:46:34 +0000 (-0600) Subject: fix bug #289: use strcpy instead of strncpy X-Git-Tag: 1.9.9-b1~535 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F294%2Fhead;p=thirdparty%2Fzlib-ng.git fix bug #289: use strcpy instead of strncpy to avoid a GCC 8 warning: test/example.c:465:48: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess] strncpy((char*)uncompr, garbage_str, sizeof(garbage_str)); --- diff --git a/test/example.c b/test/example.c index e11bd2e9..7567fc5d 100644 --- a/test/example.c +++ b/test/example.c @@ -461,8 +461,7 @@ void test_dict_inflate(unsigned char *compr, size_t comprLen, unsigned char *unc int err; PREFIX3(stream) d_stream; /* decompression stream */ - char garbage_str[] = "garbage garbage garbage"; - strncpy((char*)uncompr, garbage_str, sizeof(garbage_str)); + strcpy((char*)uncompr, "garbage garbage garbage"); d_stream.zalloc = zalloc; d_stream.zfree = zfree;