Explorar o código

dpkg-deb: fix error message output by read_fail()

read_fail() should only assume a system error if rc < 0. Any positive
value means that we did not manage to read as much data as we wanted
and should result in the "unexpected end of file" message.
Raphaël Hertzog %!s(int64=15) %!d(string=hai) anos
pai
achega
b00ef3aa35
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      dpkg-deb/extract.c

+ 1 - 1
dpkg-deb/extract.c

@@ -66,7 +66,7 @@ static void movecontrolfiles(const char *thing) {
 static void DPKG_ATTR_NORET
 read_fail(int rc, const char *filename, const char *what)
 {
-  if (rc == 0)
+  if (rc >= 0)
     ohshit(_("unexpected end of file in %s in %.255s"),what,filename);
   else
     ohshite(_("error reading %s from file %.255s"), what, filename);