aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/vga.c b/hw/vga.c
index b80ad7f8b..9f5d051fc 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2768,8 +2768,9 @@ static void vga_screen_dump_blank(VGAState *s, const char *filename)
{
FILE *f;
unsigned int y, x, w, h;
+ unsigned char blank_sample[3] = { 0, 0, 0 };
- w = s->last_scr_width * sizeof(uint32_t);
+ w = s->last_scr_width;
h = s->last_scr_height;
f = fopen(filename, "wb");
@@ -2778,7 +2779,7 @@ static void vga_screen_dump_blank(VGAState *s, const char *filename)
fprintf(f, "P6\n%d %d\n%d\n", w, h, 255);
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
- fputc(0, f);
+ fwrite(blank_sample, 3, 1, f);
}
}
fclose(f);