]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
strings: use puts() rather than printf()
authorMike Frysinger <vapier@gentoo.org>
Tue, 4 Nov 2008 21:03:46 +0000 (16:03 -0500)
committerWolfgang Denk <wd@denx.de>
Sun, 7 Dec 2008 00:17:19 +0000 (01:17 +0100)
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

index db54f29e265686d509693ddbf4bdebf3bf2a4364..7d05cf8e938d10616070fefccfcc65f75b4bdfb7 100644 (file)
@@ -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);