提交 774ce720 编写于 作者: M Mike Frysinger 提交者: Wolfgang Denk

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: NMike Frysinger <vapier@gentoo.org>
上级 b03150b5
...@@ -29,7 +29,8 @@ int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ...@@ -29,7 +29,8 @@ int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *addr = start_addr; char *addr = start_addr;
do { do {
printf("%s\n", addr); puts(addr);
puts("\n");
addr += strlen(addr) + 1; addr += strlen(addr) + 1;
} while (addr[0] && addr < last_addr); } while (addr[0] && addr < last_addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册