/* This is a NOEXEC applet. Be very careful! */
-
static void bb_dump_addfile(dumper_t *dumper, char *name)
{
char *p;
FILE *fp;
char *buf;
- fp = xfopen(name, "r");
-
+ fp = xfopen_for_read(name);
while ((buf = xmalloc_fgetline(fp)) != NULL) {
p = skip_whitespace(buf);
-
if (*p && (*p != '#')) {
bb_dump_add(dumper, p);
}
static const char add_first[] ALIGN1 = "\"%07.7_Ax\n\"";
-static const char hexdump_opts[] ALIGN1 = "bcdoxCe:f:n:s:v" USE_FEATURE_HEXDUMP_REVERSE("R");
+static const char hexdump_opts[] ALIGN1 = "bcdoxCe:f:n:s:v" IF_FEATURE_HEXDUMP_REVERSE("R");
static const struct suffix_mult suffixes[] = {
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
int hexdump_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
do {
char *buf;
- fp = xfopen(*argv, "r");
+ fp = xfopen_for_read(*argv);
jump_in:
while ((buf = xmalloc_fgetline(fp)) != NULL) {
p = buf;