diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2016-08-04 21:09:23 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-08-05 00:09:23 -0400 |
commit | 82b103a7ce299effbb151a2cd7f0b3c7d29aefad (patch) | |
tree | a18bc2eab5e098da41277f4c733b0bd219916a1f /src/basic | |
parent | 2604646c05fcb8a10dadc302ea5a376a56faaa73 (diff) |
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.
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/fileio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c index c18ac39e03..588eacd77c 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -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; |