aboutsummaryrefslogtreecommitdiff
path: root/miscutils/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/strings.c')
-rw-r--r--miscutils/strings.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 57a2c0a17..5efbabf6f 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -23,7 +23,7 @@ int strings_main(int argc ATTRIBUTE_UNUSED, char **argv)
23 unsigned opt; 23 unsigned opt;
24 unsigned count; 24 unsigned count;
25 off_t offset; 25 off_t offset;
26 FILE *file = stdin; 26 FILE *file;
27 char *string; 27 char *string;
28 const char *fmt = "%s: "; 28 const char *fmt = "%s: ";
29 const char *n_arg = "4"; 29 const char *n_arg = "4";
@@ -40,16 +40,14 @@ int strings_main(int argc ATTRIBUTE_UNUSED, char **argv)
40 if (!*argv) { 40 if (!*argv) {
41 fmt = "{%s}: "; 41 fmt = "{%s}: ";
42 *--argv = (char *)bb_msg_standard_input; 42 *--argv = (char *)bb_msg_standard_input;
43 goto PIPE;
44 } 43 }
45 44
46 do { 45 do {
47 file = fopen_or_warn(*argv, "r"); 46 file = fopen_or_warn_stdin(*argv);
48 if (!file) { 47 if (!file) {
49 status = EXIT_FAILURE; 48 status = EXIT_FAILURE;
50 continue; 49 continue;
51 } 50 }
52 PIPE:
53 offset = 0; 51 offset = 0;
54 count = 0; 52 count = 0;
55 do { 53 do {