]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: fdtgrep: Use unsigned chars for arrays
authorSamuel Dionne-Riel <samuel@dionne-riel.com>
Thu, 11 Feb 2021 00:43:09 +0000 (19:43 -0500)
committerSimon Glass <sjg@chromium.org>
Mon, 22 Mar 2021 06:23:26 +0000 (19:23 +1300)
Otherwise, values over 127 end up prefixed with ffffff.

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/fdtgrep.c

index e4112b8f692f2e88c52548a824021835905f5042..db512465db1c255bb2dd60b9b23e0a596f53f378 100644 (file)
@@ -213,7 +213,7 @@ static void utilfdt_print_data(const char *data, int len)
        } else {
                printf(" = [");
                for (i = 0; i < len; i++)
-                       printf("%02x%s", *p++, i < len - 1 ? " " : "");
+                       printf("%02x%s", (unsigned char)*p++, i < len - 1 ? " " : "");
                printf("]");
        }
 }