Browse Source

fix printf format args

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
eb091f03e3
2 changed files with 6 additions and 5 deletions
  1. 5
    5
      src/core/debug.c
  2. 1
    0
      src/core/image.c

+ 5
- 5
src/core/debug.c View File

@@ -25,10 +25,10 @@ void hex_dump ( const char *data, const unsigned int len ) {
25 25
 			more();
26 26
 		}
27 27
 		if ( ( index % 16 ) == 0 ) {
28
-			printf ( "%X [%X] : %hX :", data + index,
28
+			printf ( "%p [%lX] : %X :", data + index,
29 29
 				 virt_to_phys ( data + index ), index );
30 30
 		}
31
-		printf ( " %hhX", data[index] );
31
+		printf ( " %02X", data[index] );
32 32
 	}
33 33
 	printf ( "\n" );
34 34
 }
@@ -64,19 +64,19 @@ int check_region ( void *region, size_t len ) {
64 64
 			/* Start of corruption */
65 65
 			if ( corrupted == 0 ) {
66 66
 				corrupted = 1;
67
-				printf ( "Region %#x-%#x (physical %#x-%#x) "
67
+				printf ( "Region %p-%p (physical %#lx-%#lx) "
68 68
 					 "corrupted\n",
69 69
 					 region, region + len,
70 70
 					 virt_to_phys ( region ),
71 71
 					 virt_to_phys ( region + len ) );
72 72
 			}
73 73
 			in_corruption = 1;
74
-			printf ( "--- offset %#x ", offset );
74
+			printf ( "--- offset %#lx ", offset );
75 75
 		} else if ( ( in_corruption != 0 ) &&
76 76
 			    ( test == GUARD_SYMBOL ) ) {
77 77
 			/* End of corruption */
78 78
 			in_corruption = 0;
79
-			printf ( "to offset %#x", offset );
79
+			printf ( "to offset %#lx", offset );
80 80
 		}
81 81
 
82 82
 	}

+ 1
- 0
src/core/image.c View File

@@ -2,6 +2,7 @@
2 2
 #include "buffer.h"
3 3
 #include "load_buffer.h"
4 4
 #include "image.h"
5
+#include <console.h>
5 6
 
6 7
 static struct image images[0] __image_start;
7 8
 static struct image images_end[0] __image_end;

Loading…
Cancel
Save