fileio: fix MIN/MAX mixup (#3896)

The intention is to clamp the value to READ_FULL_BYTES_MAX, which
would be the minimum of the two.
This commit is contained in:
Vito Caputo
2016-08-04 21:09:23 -07:00
committed by Zbigniew Jędrzejewski-Szmek
parent 2604646c05
commit 82b103a7ce

View File

@@ -271,7 +271,7 @@ int read_full_stream(FILE *f, char **contents, size_t *size) {
if (n >= READ_FULL_BYTES_MAX)
return -E2BIG;
n = MAX(n * 2, READ_FULL_BYTES_MAX);
n = MIN(n * 2, READ_FULL_BYTES_MAX);
}
buf[l] = 0;