]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: unused variable warning
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 18 Nov 2023 06:05:42 +0000 (07:05 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 18 Nov 2023 06:05:42 +0000 (07:05 +0100)
And ensure that the output string is always terminated.

memcheck/tests/freebsd/aio_read.c

index b7e2915d19c2c4985d0bbec72d99bd35834605be..f524f3b22d9df41f454081c004cc6235122d853b 100644 (file)
@@ -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;