]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/loclass/ikeys.c
Update ikeys.c (#537)
[proxmark3-svn] / client / loclass / ikeys.c
index 8892b4a35296d7b2aa2000a921eca5bd04a64e2d..2a6a00109297c72afe47de08426814f37a510f7e 100644 (file)
@@ -22,7 +22,7 @@
  *
  * This is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
+ * by the Free Software Foundation, or, at your option, any later version. 
  *
  * This file is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -33,7 +33,6 @@
  * along with loclass.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * 
- * 
  ****************************************************************************/
 
 /**
@@ -740,18 +739,16 @@ int readKeyFile(uint8_t key[8])
        FILE *f;
        int retval = 1;
        f = fopen("iclass_key.bin", "rb");
-       if (f)
-       {
-               if(fread(key, sizeof(uint8_t), 8, f) == 1) 
-               {
-                       retval = 0;     
-               }
-               fclose(f);
+       if (!f)
+               return retval;
+       
+       if (fread(key, sizeof(uint8_t), 8, f) == 8) {
+               retval = 0;
        }
+       fclose(f);      
        return retval;
 }
 
-
 int doKeyTests(uint8_t debuglevel)
 {
        debug_print = debuglevel;
Impressum, Datenschutz