diff --git a/main.c b/main.c index 021162d..b2efbf5 100644 --- a/main.c +++ b/main.c @@ -224,8 +224,7 @@ void start_trace (addr_t loc, char *name) void do_ptrace (void) { - int i; - for (i = 0; i 0; len--) + for(int i = base_addr; len > 0; len--) f[i++] |= LOADED; start_trace(base_addr+6, "**BOOT**"); @@ -494,7 +486,7 @@ void loadfile (void) FILE *fp; int base_addr; int last_addr; - register int i; + int i; int had_header; int tmp; @@ -616,12 +608,12 @@ void binaryloadfile (void) if (entry_count) { - for (int i = 0; i < entry_count; i++) + for (int j = 0; j < entry_count; j++) { char *label = malloc(7); - sprintf (label, "e_%04x", entry_address[i]); + sprintf (label, "e_%04x", entry_address[j]); printf("label: %s\n", label); - start_trace (entry_address[i], label); + start_trace (entry_address[j], label); } } else