Fix a bug where calling MD5File(3) with a zero-length file generated an

error, due to an uninitialized variable.

Reviewed by:	phk, archie
This commit is contained in:
bmah 2002-09-06 19:51:58 +00:00
parent c10ceae56a
commit 5419354c9f

View File

@ -66,6 +66,7 @@ MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len)
len = stbuf.st_size - ofs;
if (lseek(f, ofs, SEEK_SET) < 0) return 0;
n = len;
i = 0;
while (n > 0) {
if (n > sizeof(buffer))
i = read(f, buffer, sizeof(buffer));