]>
git.ipfire.org Git - people/ms/u-boot.git/blob - common/cmd_strings.c
2 * cmd_strings.c - just like `strings` command
4 * Copyright (c) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
13 static char *start_addr
, *last_addr
;
15 int do_strings(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
22 if ((flag
& CMD_FLAG_REPEAT
) == 0) {
23 start_addr
= (char *)simple_strtoul(argv
[1], NULL
, 16);
25 last_addr
= (char *)simple_strtoul(argv
[2], NULL
, 16);
27 last_addr
= (char *)-1;
30 char *addr
= start_addr
;
34 addr
+= strlen(addr
) + 1;
35 } while (addr
[0] && addr
< last_addr
);
37 last_addr
= addr
+ (last_addr
- start_addr
);
43 U_BOOT_CMD(strings
, 3, 1, do_strings
,
45 "<addr> [byte count]\n"
46 " - display strings at <addr> for at least [byte count] or first double NUL"