int strings_main(int argc, char **argv)
{
int n, c, i = 0, status = EXIT_SUCCESS;
- unsigned long opt;
+ unsigned opt;
unsigned long count;
FILE *file = stdin;
char *string;
const char *fmt = "%s: ";
char *n_arg = "4";
- opt = bb_getopt_ulflags(argc, argv, "afon:", &n_arg);
+ opt = getopt32(argc, argv, "afon:", &n_arg);
/* -a is our default behaviour */
argc -= optind;
argv += optind;
- n = bb_xgetlarg(n_arg, 10, 1, INT_MAX);
+ n = xatoul_range(n_arg, 1, INT_MAX);
string = xzalloc(n + 1);
n--;
}
do {
- if ((file = bb_wfopen(*argv, "r"))) {
+ file = fopen_or_warn(*argv, "r");
+ if (file) {
PIPE:
count = 0;
do {
}
count++;
} while (c != EOF);
- bb_fclose_nonstdin(file);
+ fclose_if_not_stdin(file);
} else {
status = EXIT_FAILURE;
}
if (ENABLE_FEATURE_CLEAN_UP)
free(string);
- bb_fflush_stdout_and_exit(status);
+ fflush_stdout_and_exit(status);
}