diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-06-19 23:01:00 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-06-19 23:01:00 +0200 |
commit | f62009303a8bb9d02462e4eebbbded66c56891b0 (patch) | |
tree | da5f0ffdec7e44e17bb08bd2eb88f57eebae4ba3 | |
parent | 906963ae7667ae06951e12c0f02032184a4e23fd (diff) | |
download | rockbox-f62009303a8bb9d02462e4eebbbded66c56891b0.tar.gz rockbox-f62009303a8bb9d02462e4eebbbded66c56891b0.zip |
rknanoutils: fix crash with no prefix, remove debug code
Change-Id: I73e277a8dc2fbd5790b1d7173e449d883710f27a
-rw-r--r-- | utils/rknanoutils/rkboottool/rkboottool.c | 15 |
1 files 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) | |||
321 | 321 | ||
322 | static void extract_elf_section(struct elf_params_t *elf, int count) | 322 | static void extract_elf_section(struct elf_params_t *elf, int count) |
323 | { | 323 | { |
324 | if(g_out_prefix == NULL) | ||
325 | return; | ||
324 | char *filename = xmalloc(strlen(g_out_prefix) + 32); | 326 | char *filename = xmalloc(strlen(g_out_prefix) + 32); |
325 | sprintf(filename, "%s%d.elf", g_out_prefix, count); | 327 | sprintf(filename, "%s%d.elf", g_out_prefix, count); |
326 | if(g_debug) | 328 | if(g_debug) |
@@ -341,19 +343,6 @@ static int do_nanostage_image(uint8_t *buf, unsigned long size) | |||
341 | return 1; | 343 | return 1; |
342 | struct rknano_stage_header_t *hdr = (void *)buf; | 344 | struct rknano_stage_header_t *hdr = (void *)buf; |
343 | 345 | ||
344 | uint32_t *buf32 = (void *)buf; | ||
345 | cprintf(BLUE, "Dump\n"); | ||
346 | for(int j = 0; j < 2; j++) | ||
347 | cprintf(YELLOW, "%8x ", buf32[j]); | ||
348 | printf("\n"); | ||
349 | for(unsigned i = 0; i < hdr->count; i++) | ||
350 | { | ||
351 | for(int j = 0; j < 8; j++) | ||
352 | cprintf(YELLOW, "%8x ", buf32[i * 8 + j + 2]); | ||
353 | printf("\n"); | ||
354 | } | ||
355 | printf("\n"); | ||
356 | |||
357 | cprintf(BLUE, "Header\n"); | 346 | cprintf(BLUE, "Header\n"); |
358 | cprintf(GREEN, " Base Address: "); | 347 | cprintf(GREEN, " Base Address: "); |
359 | cprintf(YELLOW, "%#08x\n", hdr->addr); | 348 | cprintf(YELLOW, "%#08x\n", hdr->addr); |