Here is a small fix to prevent a segmentation fault in lbtdump.

The format specifier in the printf statements have been changed from
%08lx to %08llx or similar where uint64_t are being displayed.

Signed-off-by: Ben Hewson <ben@hewson-venieri.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Ben Hewson 2007-05-20 17:10:17 +00:00 committed by Uwe Hermann
parent 7f4040af82
commit 917bf6b99e
1 changed files with 8 additions and 8 deletions

View File

@ -110,30 +110,30 @@ void pretty_print_number(FILE *stream, uint64_t value)
{ {
if (value > 1024ULL*1024*1024*1024*1024*1024) { if (value > 1024ULL*1024*1024*1024*1024*1024) {
value /= 1024ULL*1024*1024*1024*1024*1024; value /= 1024ULL*1024*1024*1024*1024*1024;
fprintf(stream, "%ldEB", value); fprintf(stream, "%lldEB", value);
} }
else if (value > 1024ULL*1024*1024*1024*1024) { else if (value > 1024ULL*1024*1024*1024*1024) {
value /= 1024ULL*1024*1024*1024*1024; value /= 1024ULL*1024*1024*1024*1024;
fprintf(stream, "%ldPB", value); fprintf(stream, "%lldPB", value);
} }
else if (value > 1024ULL*1024*1024*1024) { else if (value > 1024ULL*1024*1024*1024) {
value /= 1024ULL*1024*1024*1024; value /= 1024ULL*1024*1024*1024;
fprintf(stream, "%ldTB", value); fprintf(stream, "%lldTB", value);
} }
else if (value > 1024ULL*1024*1024) { else if (value > 1024ULL*1024*1024) {
value /= 1024ULL*1024*1024; value /= 1024ULL*1024*1024;
fprintf(stream, "%ldGB", value); fprintf(stream, "%lldGB", value);
} }
else if (value > 1024ULL*1024) { else if (value > 1024ULL*1024) {
value /= 1024ULL*1024; value /= 1024ULL*1024;
fprintf(stream, "%ldMB", value); fprintf(stream, "%lldMB", value);
} }
else if (value > 1024ULL) { else if (value > 1024ULL) {
value /= 1024ULL; value /= 1024ULL;
fprintf(stream, "%ldKB", value); fprintf(stream, "%lldKB", value);
} }
else { else {
fprintf(stream, "%ldB", value); fprintf(stream, "%lldB", value);
} }
} }
@ -156,7 +156,7 @@ void print_memory(struct lb_record *ptr, unsigned long addr)
default: default:
case 2: mem_type = "reserved"; break; case 2: mem_type = "reserved"; break;
} }
printf("0x%08lx - 0x%08lx %s (", printf("0x%08llx - 0x%08llx %s (",
start, end, mem_type); start, end, mem_type);
pretty_print_number(stdout, start); pretty_print_number(stdout, start);
printf(" - "); printf(" - ");