From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 4 Nov 2008 21:03:46 +0000 (-0500)
Subject: strings: use puts() rather than printf()
X-Git-Tag: v2025.01-rc5-pxa1908~21680
X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=774ce72026f74ac9641bcbbc588b20f2e13f7ab8;p=u-boot.git

strings: use puts() rather than printf()

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

diff --git a/common/cmd_strings.c b/common/cmd_strings.c
index db54f29e26..7d05cf8e93 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);