From a346a9fb772d977b101923be71640b5c3db859a1 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Tue, 22 Jan 2019 13:46:34 -0600 Subject: [PATCH] fix bug #289: use strcpy instead of strncpy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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)); --- test/example.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.47.2