mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 18:06:33 +00:00
fix off-by-one error
This commit is contained in:
@@ -3899,7 +3899,7 @@ pub const Duration = struct {
|
|||||||
|
|
||||||
var i: usize = 0;
|
var i: usize = 0;
|
||||||
for (units) |unit| {
|
for (units) |unit| {
|
||||||
if (value > unit.factor) {
|
if (value >= unit.factor) {
|
||||||
if (i > 0) writer.writeAll(" ") catch unreachable;
|
if (i > 0) writer.writeAll(" ") catch unreachable;
|
||||||
const remainder = value % unit.factor;
|
const remainder = value % unit.factor;
|
||||||
const quotient = (value - remainder) / unit.factor;
|
const quotient = (value - remainder) / unit.factor;
|
||||||
|
Reference in New Issue
Block a user