X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fft_build.c;h=980e40f55d55f639219775c120a125e17804dd09;hb=0dc018ece13effc689e47479ea9ebf1c98a507f5;hp=b5a997c1ba5ed514cdb1e1e9650bd4757c938b1f;hpb=92c427b18982167064de454ae5248ec466998919;p=u-boot diff --git a/common/ft_build.c b/common/ft_build.c index b5a997c1ba..980e40f55d 100644 --- a/common/ft_build.c +++ b/common/ft_build.c @@ -87,9 +87,9 @@ static int lookup_string(struct ft_cxt *cxt, const char *name) p = cxt->p; while (p < cxt->p_end) { - if (strcmp(p, name) == 0) + if (strcmp((char *)p, name) == 0) return p - cxt->p; - p += strlen(p) + 1; + p += strlen((char *)p) + 1; } return -1; @@ -103,7 +103,7 @@ void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz) if (off == -1) { memcpy(cxt->p_end, name, strlen(name) + 1); off = cxt->p_end - cxt->p; - cxt->p_end += strlen(name) + 2; + cxt->p_end += strlen(name) + 1; } /* now put offset from beginning of *STRUCTURE* */ @@ -143,9 +143,9 @@ void ft_init_cxt(struct ft_cxt *cxt, void *blob) cxt->p_rsvmap += SIZE_OF_RSVMAP_ENTRY; } - cxt->p_start = (char*)bph + bph->off_dt_struct; - cxt->p_end = (char *)bph + bph->totalsize; - cxt->p = (char *)bph + bph->off_dt_strings; + cxt->p_start = (u8 *)bph + bph->off_dt_struct; + cxt->p_end = (u8 *)bph + bph->totalsize; + cxt->p = (u8 *)bph + bph->off_dt_strings; } /* add a reserver physical area to the rsvmap */ @@ -219,7 +219,9 @@ static void print_data(const void *data, int len) return; if (is_printable_string(data, len)) { - printf(" = \"%s\"", (char *)data); + puts(" = \""); + puts(data); + puts("\""); return; }