Skip to content

Commit 40e3e2e

Browse files
committed
Let's not crash after 2**32 loops.
1 parent b1bfe19 commit 40e3e2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ fn main() -> ! {
225225

226226
info!("VGA intialised");
227227

228-
let mut x = 0;
228+
let mut x: u32 = 0;
229229
loop {
230230
println!("x = {}", x);
231-
x = x + 1;
231+
x = x.wrapping_add(1);
232232
}
233233
}
234234

0 commit comments

Comments
 (0)