[U-Boot] [PATCH] strings: use puts() rather than printf()

Mike Frysinger vapier at gentoo.org
Tue Nov 4 22:03:46 CET 2008


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 at 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



More information about the U-Boot mailing list