From: Paul Floyd Date: Sat, 18 Nov 2023 06:05:42 +0000 (+0100) Subject: FreeBSD regtest: unused variable warning X-Git-Tag: VALGRIND_3_23_0~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8113cc7f8a96a67c0f295a830a8f24a911996b04;p=thirdparty%2Fvalgrind.git FreeBSD regtest: unused variable warning And ensure that the output string is always terminated. --- diff --git a/memcheck/tests/freebsd/aio_read.c b/memcheck/tests/freebsd/aio_read.c index b7e2915d19..f524f3b22d 100644 --- a/memcheck/tests/freebsd/aio_read.c +++ b/memcheck/tests/freebsd/aio_read.c @@ -15,7 +15,7 @@ #define ERR_EXIT(msg) do { perror(msg); exit(1); } while(0) int main() { - int fd, ret; + int ret; char buf[64]; struct aiocb my_aiocb; @@ -41,6 +41,7 @@ int main() { ERR_EXIT("aio_return"); } + buf[63] = '\0'; printf("content: %s\n", buf); return 0;