1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

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
This commit is contained in:
Andreas Schneider 2021-08-16 12:42:47 +02:00 committed by Jeremy Allison
parent 86fddfa311
commit 1ce08f72a9

View File

@ -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;
}