From 84faf1a7ecdc471d7de8f097e30f799c17481b57 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 16 Apr 2017 22:09:42 +0300 Subject: [PATCH] Expansion config save fix when custom sort order was enabled. --- cfgfile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index 52f5baa4..42bf8eab 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -739,7 +739,8 @@ end: } static void cfgfile_dwrite_coords(struct zfile *f, const TCHAR *option, int x, int y) { - cfgfile_dwrite(f, option, _T("%d,%d"), x, y); + if (x || y) + cfgfile_dwrite(f, option, _T("%d,%d"), x, y); } static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *value, int d, int target) { @@ -1280,7 +1281,8 @@ static void cfgfile_write_board_rom(struct uae_prefs *prefs, struct zfile *f, st if (br->device_order > 0 && prefs->autoconfig_custom_sort) { if (buf2[0]) _tcscat(buf2, _T(",")); - _stprintf(buf2, _T("order=%d"), br->device_order); + TCHAR *p2 = buf2 + _tcslen(buf2); + _stprintf(p2, _T("order=%d"), br->device_order); } if (br->roms[i].autoboot_disabled) { if (buf2[0]) -- 2.47.3