Fix issue in file_stream.c - it would corrupt memory if

maxlen is negative
This commit is contained in:
twinaphex 2019-07-06 06:20:01 +02:00
parent 46ed5c3fcb
commit 538cca8bcd

View File

@ -221,6 +221,9 @@ int filestream_scanf(RFILE *stream, const char* format, ...)
int ret = 0;
int64_t maxlen = filestream_read(stream, buf, sizeof(buf)-1);
if (maxlen <= 0)
return EOF;
buf[maxlen] = '\0';
va_start(args, format);