[gcab] decomp: fix gcc warning strict-overflow



commit e48074952743f53d8ac529d4debc421e7e0f6937
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Fri Jul 31 00:28:38 2015 +0200

    decomp: fix gcc warning strict-overflow

 libgcab/decomp.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgcab/decomp.c b/libgcab/decomp.c
index 43f59de..cce368e 100644
--- a/libgcab/decomp.c
+++ b/libgcab/decomp.c
@@ -1001,7 +1001,9 @@ int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) {
             window_posn += match_length;
 
             /* copy match data - no worries about destination wraps */
-            while (match_length-- > 0) *rundest++ = *runsrc++;
+            memcpy(rundest, runsrc, match_length);
+            rundest += match_length;
+            runsrc += match_length;
           }
         }
         break;
@@ -1090,7 +1092,9 @@ int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) {
             window_posn += match_length;
 
             /* copy match data - no worries about destination wraps */
-            while (match_length-- > 0) *rundest++ = *runsrc++;
+            memcpy(rundest, runsrc, match_length);
+            rundest += match_length;
+            runsrc += match_length;
           }
         }
         break;


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