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.
This commit is contained in:
Filipe Azevedo 2022-08-11 23:17:00 +02:00 committed by GitHub
parent 4c4bec11f7
commit d62b866237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 */