[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rockbox-cvs
Subject:    sb1: fix buggy comparison
From:       gerrit () rockbox ! org
Date:       2014-12-20 14:33:43
Message-ID: 201412201433.sBKEXh8I019000 () giant ! haxx ! se
[Download RAW message or body]

commit 515a07e51dbb6bc0d7a3bdb5ee8e687367127dad
Author: Amaury Pouly <amaury.pouly@gmail.com>
Date:   Sat Dec 20 15:31:18 2014 +0100

    sb1: fix buggy comparison
    
    cppcheck reported:
    [rockbox/utils/imxtools/sbtools/sb1.c:440]: (warning) Comparison of a boolean \
expression with an integer other than 0 or 1.  
    Thanks to Thomas Jarosch
    
    Change-Id: I0078232706d4014a1f2acea310a7a0d0edf7788b

diff --git a/utils/imxtools/sbtools/sb1.c b/utils/imxtools/sbtools/sb1.c
index 6bc4dd8..f252ded 100644
--- a/utils/imxtools/sbtools/sb1.c
+++ b/utils/imxtools/sbtools/sb1.c
@@ -437,7 +437,7 @@ struct sb1_file_t *sb1_read_memory(void *_buf, size_t filesize, \
void *u,  
     for(int i = 0; i < g_nr_keys; i++)
     {
-        if(!g_key_array[i].method == CRYPTO_XOR_KEY)
+        if(g_key_array[i].method != CRYPTO_XOR_KEY)
             continue;
         /* copy key and data because it's modified by the crypto code */
         memcpy(key, g_key_array[i].u.xor_key, sizeof(key));
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic