1
0
Fork 0
forked from len0rd/rockbox

rknanoutils: fix crash with no prefix, remove debug code

Change-Id: I73e277a8dc2fbd5790b1d7173e449d883710f27a
This commit is contained in:
Amaury Pouly 2012-06-19 23:01:00 +02:00
parent 906963ae76
commit f62009303a

View file

@ -321,6 +321,8 @@ static void elf_write(void *user, uint32_t addr, const void *buf, size_t count)
static void extract_elf_section(struct elf_params_t *elf, int count) static void extract_elf_section(struct elf_params_t *elf, int count)
{ {
if(g_out_prefix == NULL)
return;
char *filename = xmalloc(strlen(g_out_prefix) + 32); char *filename = xmalloc(strlen(g_out_prefix) + 32);
sprintf(filename, "%s%d.elf", g_out_prefix, count); sprintf(filename, "%s%d.elf", g_out_prefix, count);
if(g_debug) if(g_debug)
@ -341,19 +343,6 @@ static int do_nanostage_image(uint8_t *buf, unsigned long size)
return 1; return 1;
struct rknano_stage_header_t *hdr = (void *)buf; struct rknano_stage_header_t *hdr = (void *)buf;
uint32_t *buf32 = (void *)buf;
cprintf(BLUE, "Dump\n");
for(int j = 0; j < 2; j++)
cprintf(YELLOW, "%8x ", buf32[j]);
printf("\n");
for(unsigned i = 0; i < hdr->count; i++)
{
for(int j = 0; j < 8; j++)
cprintf(YELLOW, "%8x ", buf32[i * 8 + j + 2]);
printf("\n");
}
printf("\n");
cprintf(BLUE, "Header\n"); cprintf(BLUE, "Header\n");
cprintf(GREEN, " Base Address: "); cprintf(GREEN, " Base Address: ");
cprintf(YELLOW, "%#08x\n", hdr->addr); cprintf(YELLOW, "%#08x\n", hdr->addr);