From 1dae345b247e5f9a6be70c69f6b402cbd30abdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Sat, 27 Feb 2021 18:29:59 +0100 Subject: [PATCH 1/2] Use memmove for overlapping copy --- Core/save_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/save_state.c b/Core/save_state.c index 9ef6ae35..827cf575 100644 --- a/Core/save_state.c +++ b/Core/save_state.c @@ -150,7 +150,7 @@ static bool verify_and_update_state_compatibility(GB_gameboy_t *gb, GB_gameboy_t { if (save->ram_size == 0 && (&save->ram_size)[-1] == gb->ram_size) { /* This is a save state with a bad printer struct from a 32-bit OS */ - memcpy(save->extra_oam + 4, save->extra_oam, (uintptr_t)&save->ram_size - (uintptr_t)&save->extra_oam); + memmove(save->extra_oam + 4, save->extra_oam, (uintptr_t)&save->ram_size - (uintptr_t)&save->extra_oam); } if (save->ram_size == 0) { /* Save doesn't have ram size specified, it's a pre 0.12 save state with potentially From 0a4cb8148f6bcecd20486a6563a43eb9c074500c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Sat, 27 Feb 2021 18:33:22 +0100 Subject: [PATCH 2/2] Fix DESTDIR installation Installing into a fresh DESTDIR would error out due to non-existent bin directory --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f98132a..51403a65 100644 --- a/Makefile +++ b/Makefile @@ -438,7 +438,7 @@ ICON_NAMES := apps/sameboy mimetypes/x-gameboy-rom mimetypes/x-gameboy-color-rom ICON_SIZES := 16x16 32x32 64x64 128x128 256x256 512x512 ICONS := $(foreach name,$(ICON_NAMES), $(foreach size,$(ICON_SIZES),$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(size)/$(name).png)) install: sdl $(DESTDIR)$(PREFIX)/share/mime/packages/sameboy.xml $(ICONS) FreeDesktop/sameboy.desktop - mkdir -p $(DESTDIR)$(PREFIX)/share/sameboy/ + mkdir -p $(DESTDIR)$(PREFIX)/share/sameboy/ $(DESTDIR)$(PREFIX)/bin/ cp -rf $(BIN)/SDL/* $(DESTDIR)$(PREFIX)/share/sameboy/ mv $(DESTDIR)$(PREFIX)/share/sameboy/sameboy $(DESTDIR)$(PREFIX)/bin/sameboy ifeq ($(DESTDIR),)