Merge pull request #166 from apritzel/build_fixes

nandpart and fit-image build fixes
This commit is contained in:
Chen-Yu Tsai 2022-01-16 21:51:46 +08:00 committed by GitHub
commit 4fa6de79c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -77,13 +77,13 @@ static int fit_parse_arch(const char *value)
static uint32_t fdt_getprop_u32(const void *fdt, int node, const char *name)
{
const struct fdt_property *prop;
const fdt32_t *val;
prop = fdt_get_property(fdt, node, name, NULL);
if (!prop)
val = fdt_getprop(fdt, node, name, NULL);
if (!val)
return ~0U;
return be32toh(*(uint32_t *)prop->data);
return fdt32_to_cpu(*val);
}
static const char *fdt_getprop_str(const void *fdt, int node, const char *name)

View File

@ -90,7 +90,7 @@ static MBR *_get_mbr(int fd, int mbr_num, int force)
printf("check partition table copy %d: ", mbr_num);
printmbrheader(mbr);
if (force) {
strncpy((char *)mbr->magic, MBR_MAGIC, 8);
memcpy(mbr->magic, MBR_MAGIC, 8);
mbr->version = MBR_VERSION;
return mbr;
}