Skip to content

Commit

Permalink
od: refactor default output mode (#433)
Browse files Browse the repository at this point in the history
* Dedicated if-statement is not required for setting -o as the default output format for od; use the default case for setting $fmt instead
  • Loading branch information
mknos authored Jan 31, 2024
1 parent 19dcfe2 commit 2f0ea85
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/od
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ if (defined($lim) && $lim == 0) {
exit EX_SUCCESS;
}

$opt_o = 1 if ! ($opt_b || $opt_c || $opt_d || $opt_f || $opt_i ||
$opt_l || $opt_o || $opt_x);

my $fmt;
if ($opt_b) {
$fmt = \&octal1;
Expand All @@ -134,7 +131,7 @@ elsif ($opt_x) {
$fmt = \&hex;
}
else {
help();
$fmt = \&octal2;
}

my $buf;
Expand Down

0 comments on commit 2f0ea85

Please sign in to comment.