]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/mifarehost.c
Patch by jonor, fixes so uart_receive does not block when data is continuosly receive...
[proxmark3-svn] / client / mifarehost.c
index 825e06d88609b74d8dcafc6495e72b3bed1baab6..9676e6f7a63e28fe2ae64a196947220d2ed00861 100644 (file)
@@ -15,7 +15,6 @@
 #include "proxmark3.h"\r
 \r
 // MIFARE\r
-\r
 int compar_int(const void * a, const void * b) {\r
        return (*(uint64_t*)b - *(uint64_t*)a);\r
 }\r
@@ -327,7 +326,10 @@ int loadTraceCard(uint8_t *tuid) {
        blockNum = 0;\r
        while(!feof(f)){\r
                memset(buf, 0, sizeof(buf));\r
-               fgets(buf, sizeof(buf), f);\r
+               if (fgets(buf, sizeof(buf), f) == NULL) {\r
+      PrintAndLog("File reading error.");\r
+                       return 2;\r
+    }\r
 \r
                if (strlen(buf) < 32){\r
                        if (feof(f)) break;\r
Impressum, Datenschutz