From d62b86623766e4a50d944e03ca4852f727c72bcc Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Thu, 11 Aug 2022 23:17:00 +0200 Subject: [PATCH] rzipstream_gets: Fix missing eol (#14311) The eol was always stripped from the data, leading to behavior differences with filestream_gets and general read line implementations. --- libretro-common/streams/rzip_stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libretro-common/streams/rzip_stream.c b/libretro-common/streams/rzip_stream.c index c41ca46bfd..dd6ca20c07 100644 --- a/libretro-common/streams/rzip_stream.c +++ b/libretro-common/streams/rzip_stream.c @@ -620,11 +620,15 @@ char* rzipstream_gets(rzipstream_t *stream, char *s, size_t len) c = rzipstream_getc(stream); /* Check for newline and EOF */ - if ((c == '\n') || (c == EOF)) + if (c == EOF) break; /* Copy character to string buffer */ *str_ptr++ = c; + + /* Check for newline and EOF */ + if (c == '\n') + break; } /* Add NUL termination */