]> git.saurik.com Git - apt.git/commitdiff
* methods/bzip2.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 16 Aug 2010 10:12:51 +0000 (12:12 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 16 Aug 2010 10:12:51 +0000 (12:12 +0200)
  - fix error checking for read in case of failing bzip2/lzma/whatever

Spotted by -Wextra:
bzip2.cc: In member function ‘virtual bool Bzip2Method::Fetch(pkgAcqMethod::FetchItem*)’:
bzip2.cc:108:19: warning: comparison of unsigned expression < 0 is always false
bzip2.cc:111:19: warning: comparison of unsigned expression < 0 is always false

debian/changelog
methods/bzip2.cc

index 23c1218d9aa66b7d243f59e38dd47e2aef79779a..f72cad087c30f456755a23de5ad0351ee5b6cd90 100644 (file)
@@ -39,8 +39,10 @@ apt (0.8.0~pre1) UNRELASED; urgency=low
     - fix LongDesc handling in LANG=C environment
   * apt-pkg/contrib/strutl.cc:
     - fix error checking for vsnprintf in its safe variant
+  * methods/bzip2.cc:
+    - fix error checking for read in case of failing bzip2/lzma/whatever
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 16 Aug 2010 11:35:53 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 16 Aug 2010 12:07:54 +0200
 
 apt (0.7.26~exp12) experimental; urgency=low
 
index 19e49828e177fd03ed9c931eaf09c86a216fd969..241f21c66bd3a30588ef85c7e5bc9da223280a2b 100644 (file)
@@ -102,9 +102,8 @@ bool Bzip2Method::Fetch(FetchItem *Itm)
    while (1) 
    {
       unsigned char Buffer[4*1024];
-      unsigned long Count;
       
-      Count = read(GzOut[0],Buffer,sizeof(Buffer));
+      ssize_t Count = read(GzOut[0],Buffer,sizeof(Buffer));
       if (Count < 0 && errno == EINTR)
         continue;