From f62009303a8bb9d02462e4eebbbded66c56891b0 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 19 Jun 2012 23:01:00 +0200 Subject: [PATCH] rknanoutils: fix crash with no prefix, remove debug code Change-Id: I73e277a8dc2fbd5790b1d7173e449d883710f27a --- utils/rknanoutils/rkboottool/rkboottool.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/utils/rknanoutils/rkboottool/rkboottool.c b/utils/rknanoutils/rkboottool/rkboottool.c index 06763f86e3..bfa7ebe291 100644 --- a/utils/rknanoutils/rkboottool/rkboottool.c +++ b/utils/rknanoutils/rkboottool/rkboottool.c @@ -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) { + if(g_out_prefix == NULL) + return; char *filename = xmalloc(strlen(g_out_prefix) + 32); sprintf(filename, "%s%d.elf", g_out_prefix, count); if(g_debug) @@ -341,19 +343,6 @@ static int do_nanostage_image(uint8_t *buf, unsigned long size) return 1; 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(GREEN, " Base Address: "); cprintf(YELLOW, "%#08x\n", hdr->addr);