public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] strings: use puts() rather than printf()
@ 2008-11-04 21:03 Mike Frysinger
  2008-11-04 21:03 ` [U-Boot] [PATCH v2] cmd_elf: CONFIG_ELF_SIMPLE_LOAD: load ELFs according to PHDRs Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mike Frysinger @ 2008-11-04 21:03 UTC (permalink / raw)
  To: u-boot

When running `strings` on really long strings, the stack tends to get
smashed due to printf().  Switch to puts() instead since we're only passing
the data through.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 common/cmd_strings.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/cmd_strings.c b/common/cmd_strings.c
index db54f29..7d05cf8 100644
--- a/common/cmd_strings.c
+++ b/common/cmd_strings.c
@@ -29,7 +29,8 @@ int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 	char *addr = start_addr;
 	do {
-		printf("%s\n", addr);
+		puts(addr);
+		puts("\n");
 		addr += strlen(addr) + 1;
 	} while (addr[0] && addr < last_addr);
 
-- 
1.6.0.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-07  0:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-04 21:03 [U-Boot] [PATCH] strings: use puts() rather than printf() Mike Frysinger
2008-11-04 21:03 ` [U-Boot] [PATCH v2] cmd_elf: CONFIG_ELF_SIMPLE_LOAD: load ELFs according to PHDRs Mike Frysinger
2008-11-05 17:14 ` [U-Boot] [PATCH] strings: use puts() rather than printf() Scott Wood
2008-12-07  0:17 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox