Skip to content

Commit 424a8ed

Browse files
committed
fixes add_100_millis helper
1 parent d3f167f commit 424a8ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/miri/tests/pass-dep/libc/libc-time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ mod test_clock_nanosleep {
420420
/// Helper function used to create an instant in the future
421421
fn add_100_millis(mut ts: libc::timespec) -> libc::timespec {
422422
const SECOND: i64 = 1_000_000_000;
423-
ts.tv_nsec += ts.tv_nsec + SECOND / 10;
424-
ts.tv_nsec = ts.tv_nsec % SECOND;
423+
ts.tv_nsec += SECOND / 10;
425424
ts.tv_sec = ts.tv_nsec / SECOND;
425+
ts.tv_nsec %= SECOND;
426426
ts
427427
}
428428
}

0 commit comments

Comments
 (0)