From: Toni Wilen Date: Sun, 16 Apr 2017 19:09:42 +0000 (+0300) Subject: Expansion config save fix when custom sort order was enabled. X-Git-Tag: 3500~60 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=84faf1a7ecdc471d7de8f097e30f799c17481b57;p=francis%2Fwinuae.git Expansion config save fix when custom sort order was enabled. --- 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])