diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2021-01-06 14:52:26 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-01-15 16:58:40 +1100 |
commit | ca16a723fa9dde9c5da80dba567f48715000e77c (patch) | |
tree | 0abe0e46397fedcae5ce29eb3d5e5db50470ecc3 /fdtdump.c | |
parent | 64990a272e8f7cbbdfd5a53f752b5a0db7ddf41c (diff) | |
download | dtc-ca16a723fa9dde9c5da80dba567f48715000e77c.zip dtc-ca16a723fa9dde9c5da80dba567f48715000e77c.tar.gz dtc-ca16a723fa9dde9c5da80dba567f48715000e77c.tar.bz2 |
fdtdump: Fix gcc11 warning
In one place, fdtdump abuses fdt_set_magic(), passing it just a small char
array instead of the full fdt header it expects. That's relying on the
fact that in fact fdt_set_magic() will only actually access the first 4
bytes of the buffer.
This trips a new warning in GCC 11 - and it's entirely possible it was
always UB. So, don't do that.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'fdtdump.c')
-rw-r--r-- | fdtdump.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -217,7 +217,7 @@ int main(int argc, char *argv[]) char *p = buf; char *endp = buf + len; - fdt_set_magic(smagic, FDT_MAGIC); + fdt32_st(smagic, FDT_MAGIC); /* poor man's memmem */ while ((endp - p) >= FDT_MAGIC_SIZE) { |