Index: src/lib/libmd/mdXhl.c =================================================================== --- src/lib/libmd/mdXhl.c +++ src/lib/libmd/mdXhl.c @@ -74,7 +74,7 @@ i = read(f, buffer, sizeof(buffer)); else i = read(f, buffer, n); - if (i < 0) + if (i <= 0) break; MDXUpdate(&ctx, buffer, i); n -= i;