]> git.sur5r.net Git - openocd/blobdiff - contrib/itmdump.c
contrib: itmdump: fix incorrect format printf
[openocd] / contrib / itmdump.c
index 1c484d0a4858f822dfac3f8508a929bb2d48153f..fe835493437587eff7bb385d0b869c29d64e03c9 100644 (file)
@@ -130,7 +130,7 @@ static bool read_varlen(FILE *f, int c, unsigned *value)
 
        *value =  (buf[3] << 24)
                + (buf[2] << 16)
-               + (buf[2] << 8)
+               + (buf[1] << 8)
                + (buf[0] << 0);
        return true;
 
@@ -146,7 +146,7 @@ static void show_hard(FILE *f, int c)
        unsigned size;
        char *label;
 
-       printf("DWT - ", type);
+       printf("DWT - ");
 
        if (!read_varlen(f, c, &value))
                return;
@@ -216,7 +216,7 @@ static void show_hard(FILE *f, int c)
                }
                break;
        default:
-               printf("UNDEFINED");
+               printf("UNDEFINED, rawtype: %x", type);
                break;
        }