Commit Diff
Commit:
1b135dc5bb5281071f67d2d5c3d44db56fc6ca54
Date:
Tue Jul 26 06:59:44 2022
UTC
Message
fix off by one in the offsets line
--- contrib/amused-monitor
+++ contrib/amused-monitor
@@ -133,9 +133,9 @@ sub center {
my ($str, $pstr) = @_;
my $width = mbswidth($str);
return $str if $width > $COLS;
- my $pre = ($COLS - $width) / 2;
+ my $pre = round(($COLS - $width) / 2);
my $lpad = $pstr x $pre;
- my $rpad = $pstr x ($COLS - $width - $pre + 1);
+ my $rpad = $pstr x ($COLS - $width - $pre);
return ($lpad, $str, $rpad);
}
Omar Polo