]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/cmd_strings.c
readline(): Add ability to modify a string buffer
[people/ms/u-boot.git] / common / cmd_strings.c
index bbf56a033be95fdd94eb08f85e88683759acecbb..3a0d8ff43adbaa3e8a6fdb38023c4ea9a927fa61 100644 (file)
 #include <common.h>
 #include <command.h>
 
-#ifdef CONFIG_CFG_STRINGS
-
 static char *start_addr, *last_addr;
 
 int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        if (argc == 1) {
-               printf("Usage:\n%s\n", cmdtp->usage);
+               cmd_usage(cmdtp);
                return 1;
        }
 
@@ -31,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);
 
@@ -42,8 +41,7 @@ int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 U_BOOT_CMD(strings, 3, 1, do_strings,
-       "strings - display strings\n",
+       "display strings",
        "<addr> [byte count]\n"
-       "    - display strings at <addr> for at least [byte count] or first double NUL\n");
-
-#endif
+       "    - display strings at <addr> for at least [byte count] or first double NUL"
+);