From 5419354c9fc7ce9e7f3f8f8c77527836b83b3d93 Mon Sep 17 00:00:00 2001 From: bmah Date: Fri, 6 Sep 2002 19:51:58 +0000 Subject: Fix a bug where calling MD5File(3) with a zero-length file generated an error, due to an uninitialized variable. Reviewed by: phk, archie --- lib/libmd/mdXhl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libmd/mdXhl.c b/lib/libmd/mdXhl.c index 439e9ff..ae96813 100644 --- a/lib/libmd/mdXhl.c +++ b/lib/libmd/mdXhl.c @@ -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)); -- cgit v1.1