]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/fido/cbortools.c
Fix some printf/scanf format strings
[proxmark3-svn] / client / fido / cbortools.c
index 01691dad10444b68e1aab308d46d8aad4021d419..6cddabfabf24eb29664a50ee91ffb06b76f50b2a 100644 (file)
 //
 
 #include "cbortools.h"
+
 #include <stdlib.h>
+#include <inttypes.h>
+
 #include "emv/emvjson.h"
 #include "util.h"
 #include "fidocore.h"
@@ -37,7 +40,7 @@ static CborError dumpelm(CborValue *it, bool *got_next, int nestingLevel) {
        case CborIntegerType: {
                int64_t val;
                cbor_value_get_int64(it, &val);     // can't fail
-               printf("%lld", (long long)val);
+               printf("%" PRIi64, val);
                break;
        }
 
@@ -68,7 +71,7 @@ static CborError dumpelm(CborValue *it, bool *got_next, int nestingLevel) {
        case CborTagType: {
                CborTag tag;
                cbor_value_get_tag(it, &tag);     
-               printf("Tag(%lld)", (long long)tag);
+               printf("Tag(%" PRIu64, tag);
                break;
        }
 
@@ -203,13 +206,7 @@ int TinyCborPrintFIDOPackage(uint8_t cmdCode, bool isResponse, uint8_t *data, si
     CborError err = dumprecursive(cmdCode, isResponse, &cb, false, 0);
 
        if (err) {
-               fprintf(stderr,
-#if __WORDSIZE == 64           
-               "CBOR parsing failure at offset %" PRId64 " : %s\n",
-#else
-               "CBOR parsing failure at offset %" PRId32 " : %s\n",    
-#endif
-               cb.ptr - data, cbor_error_string(err));
+               fprintf(stderr, "CBOR parsing failure at offset %td : %s\n", cb.ptr - data, cbor_error_string(err));
                return 1;
        }       
        
Impressum, Datenschutz