summaryrefslogtreecommitdiff
path: root/test/example.c
diff options
context:
space:
mode:
authorSebastian Pop <s.pop@samsung.com>2019-01-22 13:46:34 -0600
committerHans Kristian Rosbach <hk-github@circlestorm.org>2019-01-24 12:50:49 +0100
commita346a9fb772d977b101923be71640b5c3db859a1 (patch)
treef2795f383be36e216bd6af9ea477e0047d89df89 /test/example.c
parent34799666442565d2caa49e83697e6849064c7687 (diff)
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));
Diffstat (limited to 'test/example.c')
-rw-r--r--test/example.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/example.c b/test/example.c
index e11bd2e..7567fc5 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;