From aa4eaaceedb6ab98d85f36b252d0bdcef4172815 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Aug 2026 05:17:44 +0200 Subject: [PATCH] testsuites/fstests: Fix the tftpfs read loop The read loop is bounded by a byte budget of type size_t. Every test passes SIZE_MAX to say that there is no budget. Commit bd2055cf5a cast the budget to ssize_t to silence a sign compare warning, which turned SIZE_MAX into -1, so the loop condition was false right away and read() was never called. Cast the loop variable instead. It is positive by the first operand of the condition, so the cast preserves its value. Close #5713. Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber --- testsuites/fstests/tftpfs/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuites/fstests/tftpfs/init.c b/testsuites/fstests/tftpfs/init.c index 876be16fc3..077b3b2205 100644 --- a/testsuites/fstests/tftpfs/init.c +++ b/testsuites/fstests/tftpfs/init.c @@ -347,7 +347,7 @@ static int read_tftp_file( if ( *fd >= 0 ) { data_buffer = malloc( buffer_size ); - while ( bytes > 0 && (ssize_t) max_bytes >= bytes ) { + while ( bytes > 0 && max_bytes >= (size_t) bytes ) { errno = 0; bytes = read( *fd,