diff --git a/tools/3dump b/tools/3dump index dfbf321..4ac6301 100755 --- a/tools/3dump +++ b/tools/3dump @@ -17,9 +17,9 @@ while (1) { my $word= (($b1 & 077) << 12) | (($b2 & 077) << 6) | ($b3 & 077); my $c1= ($word >> 9) & 0777; - $c1= ($c1 < 0200) ? chr($c1) : " "; + $c1= (($c1 >= 32) && ($c1 <= 126)) ? chr($c1) : ' '; my $c2= $word & 0777; - $c2= ($c2 < 0200) ? chr($c2) : " "; + $c2= (($c2 >= 32) && ($c2 <= 126)) ? chr($c2) : ' '; printf("%06o %s%s\n", $word, $c1, $c2) } close($IN); diff --git a/tools/a7out b/tools/a7out index b5af073..0e33615 100755 --- a/tools/a7out +++ b/tools/a7out @@ -1301,8 +1301,8 @@ sub word2ascii { my $c1 = ( $word >> 9 ) & 0177; my $c2 = $word & 0177; my $result = ""; - $result .= chr($c1) if ($c1); - $result .= chr($c2) if ($c2); + $result .= (($c1 >= 32) && ($c1 <= 126)) ? chr($c1) : ' '; + $result .= (($c2 >= 32) && ($c2 <= 126)) ? chr($c2) : ' '; return ($result); }