Subject: | bzreadline blocked on the broken bz2 files |
In Bzip2.xs:bzfile_readline() after n = bzfile_read() doing incorrect
error check: "if ( n == -1 )". However function bzfile_read() in case of
an error returns not only -1.
Would be more correct to write: "if ( n < 0 )".
Subject: | Bzip2.xs.patch |
--- Bzip2.xs.orig Tue Aug 9 21:50:58 2005
+++ Bzip2.xs Fri Nov 7 12:52:38 2008
@@ -1048,7 +1048,7 @@
}
else {
n = bzfile_read( obj, obj->bufferOfLines, sizeof(obj->bufferOfLines) );
- if ( n == -1 ) {
+ if ( n < 0 ) {
error_num = bzfile_geterrno( obj );
if ( error_num == BZ_IO_ERROR ) {