Return max buffer when trying to read more than buffer size

(was reporting error.)
DEVEL_2_0_BRANCH-1
Nathaniel Rutman 2002-05-16 23:08:34 +00:00
rodzic dbc7bd53af
commit 2643e83d66
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -50,7 +50,6 @@
This code has not been tested on anything other than Linux/i386.
*/
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h> /* open */
#include <stdio.h>
@ -412,8 +411,9 @@ read_bulk_size (int fd, int ks, int remainder, byte * dest, int destsize)
}
if (destsize && (destsize < bytes))
{
DBG (1, "read_bulk_size: buffer too small! (%d/%d)\n", destsize, bytes);
return -1;
DBG (3, "read_bulk_size: more data than buffer (%d/%d)\n",
destsize, bytes);
bytes = destsize;
}
if (bytes == 0)