From d2e6414fc68054bd8dde8a8634d5c1cdd0f0ab7a Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 19 Jul 2020 21:41:15 +0200 Subject: [PATCH] MO image creation now only allocates 2048 bytes. --- src/win/win_new_floppy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/win_new_floppy.c b/src/win/win_new_floppy.c index 30cfd8f59..ba162c06e 100644 --- a/src/win/win_new_floppy.c +++ b/src/win/win_new_floppy.c @@ -599,11 +599,11 @@ create_mo_sector_image(WCHAR *file_name, int8_t disk_size, uint8_t is_mdi, HWND pbar_max -= 2; } - empty = (unsigned char *) malloc(total_size); - memset(empty, 0x00, total_size); + empty = (unsigned char *) malloc(2048); + memset(empty, 0x00, 2048); for (i = 0; i < pbar_max; i++) { - fwrite(&empty[i << 11], 1, 2048, f); + fwrite(empty, 1, 2048, f); SendMessage(h, PBM_SETPOS, (WPARAM) i + 2, (LPARAM) 0); while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD)) {