diff options
author | Colin Cross <ccross@android.com> | 2021-12-21 11:18:15 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2022-01-07 10:56:54 -0800 |
commit | 8b908143919344e77b22be25f3eee8ad7275eb8f (patch) | |
tree | ad21cd258a7dee1a8fcdb1295a44e8ef8bd4b09c | |
parent | 46beef5c6f04e85f85625925d4d8ea3bcaace9bd (diff) | |
download | libufdt-android-t-preview-1.tar.gz |
Fix building mkdtimg against muslandroid-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-beta-3android-s-qpr3-beta-1android-t-preview-1android-s-v2-beta-3android-s-qpr3-beta-1
Fix building mkdtimg against musl libc by fixing a -Wformat error
that is not caught by glibc because glibc's fprintf is not annotated
with the __printf__ attribute:
system/libufdt/utils/src/mkdtimg_dump.c:92:21: error: flag '+' results in undefined behavior with 's' conversion specifier [-Werror,-Wformat]
fprintf(out_fp, "%+20s = %d\n", name, fdt32_to_cpu(value));
Bug: 190084016
Test: m USE_HOST_MUSL=true mkdtimg
Change-Id: Ibcb5a8839cc3c220789927a7eeffce162fb21613
-rw-r--r-- | utils/src/mkdtimg_dump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/src/mkdtimg_dump.c b/utils/src/mkdtimg_dump.c index 5ca2eb8..b28e3cf 100644 --- a/utils/src/mkdtimg_dump.c +++ b/utils/src/mkdtimg_dump.c @@ -89,19 +89,19 @@ static void free_fdt(void *fdt) { static void output_prop_int(FILE *out_fp, const char *name, uint32_t value) { - fprintf(out_fp, "%+20s = %d\n", name, fdt32_to_cpu(value)); + fprintf(out_fp, "%20s = %d\n", name, fdt32_to_cpu(value)); } static void output_prop_int_cpu(FILE *out_fp, const char *name, uint32_t value) { - fprintf(out_fp, "%+20s = %d\n", name, value); + fprintf(out_fp, "%20s = %d\n", name, value); } static void output_prop_hex(FILE *out_fp, const char *name, uint32_t value) { - fprintf(out_fp, "%+20s = %08x\n", name, fdt32_to_cpu(value)); + fprintf(out_fp, "%20s = %08x\n", name, fdt32_to_cpu(value)); } static void output_prop_str(FILE *out_fp, const char *name, const char *value) { - fprintf(out_fp, "%+20s = %s\n", name, value); + fprintf(out_fp, "%20s = %s\n", name, value); } static void output_table_header(FILE *out_fp, const struct dt_table_header *header) { |