diff options
author | Andreas Schneider <asn@samba.org> | 2021-08-16 12:42:47 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-08-16 17:20:37 +0000 |
commit | 1ce08f72a9e2558e8720b463e68174e430a67654 (patch) | |
tree | 956ebecb23be1f2f88bba0be06b742ab1025441d /lib | |
parent | 86fddfa3116a8dec86e02088a3abc3859f38a251 (diff) | |
download | samba-1ce08f72a9e2558e8720b463e68174e430a67654.tar.gz |
testsuite: Fix build with gcc >= 11.1.1
Pair-Programmed-With: Jeremy Allison <jra@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 16 17:20:37 UTC 2021 on sn-devel-184
Diffstat (limited to 'lib')
-rw-r--r-- | lib/replace/tests/testsuite.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/replace/tests/testsuite.c b/lib/replace/tests/testsuite.c index f5769b4dc4d..c0dcda55bd2 100644 --- a/lib/replace/tests/testsuite.c +++ b/lib/replace/tests/testsuite.c @@ -308,6 +308,8 @@ static int test_strndup(void) static int test_strnlen(void) { + char longlen[20] = { 0 }; + printf("test: strnlen\n"); if (strnlen("bla", 2) != 2) { printf("failure: strnlen [\nunexpected length\n]\n"); @@ -319,7 +321,9 @@ static int test_strnlen(void) return false; } - if (strnlen("some text", 20) != 9) { + memcpy(longlen, "some text", 10); + + if (strnlen(longlen, 20) != 9) { printf("failure: strnlen [\nunexpected length\n]\n"); return false; } |