From 5ebeb64cf89c26630e8de804fc49b4fd4bf00f4a Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Wed, 6 Apr 2016 15:15:58 +0300 Subject: [PATCH] don't avoid emitting part of the allocation bitmap when NOT told to do so The condition in the if statement is wrong, as what we're trying to achieve is to avoid emitting the particular piece of allocation bitmap if that piece is empty AND we specifically request to skip empty bitmaps. --- contrib/tmakatos_emitter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tmakatos_emitter.cc b/contrib/tmakatos_emitter.cc index 32ad397..c2b1118 100644 --- a/contrib/tmakatos_emitter.cc +++ b/contrib/tmakatos_emitter.cc @@ -111,7 +111,7 @@ namespace tmakatos_emitter { } void binary_emitter::emit_bmp(bool omit_if_zero) { - if (!(!bitmap && omit_if_zero)) + if (bitmap || !omit_if_zero) out_.write((const char*)&bitmap, sizeof bitmap); bitmap = 0; cur++;