diff --git a/luna/src/Bitmap.cpp b/luna/src/Bitmap.cpp index a29fc947..7fb5302b 100644 --- a/luna/src/Bitmap.cpp +++ b/luna/src/Bitmap.cpp @@ -65,10 +65,11 @@ void Bitmap::clear_region(usize start, usize bits, bool value) if (!bits) return; // Set individual bits while not on a byte boundary. - while ((start % 8) && bits--) + while ((start % 8) && bits) { set(start, value); start++; + bits--; } // Clear out the rest in bytes.