changeset 63:a2e979245441 v1.2.3

paper is retarded and caused a segfault episode 1
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Mon, 01 Aug 2022 21:41:54 -0400
parents 495a0733b2c0
children 83b8fdb45d5e
files src/gui.c
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui.c	Thu Jul 21 01:49:39 2022 -0400
+++ b/src/gui.c	Mon Aug 01 21:41:54 2022 -0400
@@ -127,15 +127,10 @@
 		MessageBox(hWnd, TEXT("Failed to save project file!"), TEXT("Saving project failed!"), MB_ICONEXCLAMATION); 
 		return;
 	}
-	unsigned char* magic;
-	static const unsigned char magic_veg[] = {0xEF, 0x29, 0xC4, 0x46, 0x4A, 0x90, 0xD2, 0x11, 0x87, 0x22, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A};
-	static const unsigned char magic_vf[] = {0xF6, 0x1B, 0x3C, 0x53, 0x35, 0xD6, 0xF3, 0x43, 0x8A, 0x90, 0x64, 0xB8, 0x87, 0x23, 0x1F, 0x7F};
-	if (type == veg)
-		memcpy(magic, magic_veg, sizeof(magic_veg));
-	else
-		memcpy(magic, magic_vf,  sizeof(magic_vf) );
+	unsigned char magic_veg[] = {0xEF, 0x29, 0xC4, 0x46, 0x4A, 0x90, 0xD2, 0x11, 0x87, 0x22, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A};
+	unsigned char magic_vf[] = {0xF6, 0x1B, 0x3C, 0x53, 0x35, 0xD6, 0xF3, 0x43, 0x8A, 0x90, 0x64, 0xB8, 0x87, 0x23, 0x1F, 0x7F};
 
-	set_data(magic, version, output);
+	set_data(type == veg ? magic_veg : magic_vf, version, output);
 
 	fclose(output);
 }