X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Fdisplay_options.c;h=cff20f375523be26aceaa88801eaa3723cc21b60;hb=dc3e6c8305dc739efce8f6395d52e9880af9f7f1;hp=f1c930463e9a22c4bcb361ad33724f296e8d2719;hpb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;p=oweals%2Fu-boot.git diff --git a/lib/display_options.c b/lib/display_options.c index f1c930463e..cff20f3755 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -24,7 +23,9 @@ char *display_options_get_banner_priv(bool newlines, const char *build_tag, build_tag); if (len > size - 3) len = size - 3; - strcpy(buf + len, "\n\n"); + if (len < 0) + len = 0; + snprintf(buf + len, size - len, "\n\n"); return buf; } @@ -65,7 +66,7 @@ void print_freq(uint64_t freq, const char *s) } if (!c) { - printf("%" PRIu64 " Hz%s", freq, s); + printf("%llu Hz%s", freq, s); return; } @@ -105,7 +106,7 @@ void print_size(uint64_t size, const char *s) } if (!c) { - printf("%" PRIu64 " Bytes%s", size, s); + printf("%llu Bytes%s", size, s); return; } @@ -175,7 +176,9 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, x = lb.us[i] = *(volatile uint16_t *)data; else x = lb.uc[i] = *(volatile uint8_t *)data; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#if defined(CONFIG_SPL_BUILD) + printf(" %x", (uint)x); +#elif defined(CONFIG_SYS_SUPPORT_64BIT_DATA) printf(" %0*llx", width * 2, (long long)x); #else printf(" %0*x", width * 2, x);