[gcab] extract: fix extaction of files without data



commit 53548febd5b13de8b46fbe87762cc5e1b3c70b63
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Wed Mar 9 17:25:01 2016 +0100

    extract: fix extaction of files without data
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763376
    
    Signed-off-by: Marc-André Lureau <marcandre lureau gmail com>

 libgcab/gcab-folder.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgcab/gcab-folder.c b/libgcab/gcab-folder.c
index 9dd037c..da14044 100644
--- a/libgcab/gcab-folder.c
+++ b/libgcab/gcab-folder.c
@@ -404,7 +404,7 @@ gcab_folder_extract (GCabFolder *self,
 
         u4 usize = file->cfile.usize;
         u4 uoffset = file->cfile.uoffset;
-        do {
+        while (usize > 0) {
             if ((nubytes + cdata.nubytes) <= uoffset) {
                 nubytes += cdata.nubytes;
                 if (!cdata_read (&cdata, res_data, self->comptype,
@@ -422,7 +422,7 @@ gcab_folder_extract (GCabFolder *self,
                 usize -= count;
                 uoffset += count;
             }
-        } while (usize > 0);
+        }
     }
 
     success = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]