# HG changeset patch # User Paper <37962225+mrpapersonic@users.noreply.github.com> # Date 1659404514 14400 # Node ID a2e97924544176121b17f3f037e96ef8f37f942e # Parent 495a0733b2c036890c96fb04f31ad662a0572a3b paper is retarded and caused a segfault episode 1 diff -r 495a0733b2c0 -r a2e979245441 src/gui.c --- 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); }