Skip to content

Commit

Permalink
sign fix in decimal1()
Browse files Browse the repository at this point in the history
* Use the correct unpack format "c" for signed char
* Add a comment to clarify why some ascii character names have an embedded space
  • Loading branch information
mknos authored Jan 23, 2025
1 parent c3cd548 commit cdb391c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/od
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ my %charescs = (
92 => ' \\\\',
);

# embedded space allows formatting without sprintf
my %charname = (
0 => 'nul',
1 => 'soh',
Expand Down Expand Up @@ -295,7 +296,7 @@ sub octal1 {
}

sub decimal1 {
@arr = unpack 'C*', $data;
@arr = unpack 'c*', $data;
$strfmt = '%4d ' x (scalar @arr);
}

Expand Down

0 comments on commit cdb391c

Please sign in to comment.