Skip to content

Commit cdb391c

Browse files
authored
sign fix in decimal1()
* Use the correct unpack format "c" for signed char * Add a comment to clarify why some ascii character names have an embedded space
1 parent c3cd548 commit cdb391c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/od

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ my %charescs = (
4444
92 => ' \\\\',
4545
);
4646

47+
# embedded space allows formatting without sprintf
4748
my %charname = (
4849
0 => 'nul',
4950
1 => 'soh',
@@ -295,7 +296,7 @@ sub octal1 {
295296
}
296297

297298
sub decimal1 {
298-
@arr = unpack 'C*', $data;
299+
@arr = unpack 'c*', $data;
299300
$strfmt = '%4d ' x (scalar @arr);
300301
}
301302

0 commit comments

Comments
 (0)