From 4d6e0e008725ffe75666af852c7d1493f2a7756e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Sep 2025 11:45:08 -0400 Subject: [PATCH] io: read_fd should only report EOF on a zero-byte return value. POSIX says that's the EOF indicator, not a non-zero a short read. --- src/io/SDL_iostream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/SDL_iostream.c b/src/io/SDL_iostream.c index 2c1544144f..4dd0e5b739 100644 --- a/src/io/SDL_iostream.c +++ b/src/io/SDL_iostream.c @@ -431,7 +431,7 @@ static size_t SDLCALL fd_read(void *userdata, void *ptr, size_t size, SDL_IOStat SDL_SetError("Error reading from datastream: %s", strerror(errno)); } bytes = 0; - } else if (bytes < size) { + } else if (bytes == 0) { *status = SDL_IO_STATUS_EOF; } return (size_t)bytes;