Bumped version to 0.1.6.5.

Added a workaround to handle possible NULL returns from malloc; we now call a wrapper function which will notify the user, clean up and then exit the application if that happens.
This commit is contained in:
waltje
2018-09-23 16:35:28 -04:00
parent 116a7f68af
commit 428528ff57
25 changed files with 95 additions and 43 deletions

View File

@@ -819,6 +819,7 @@ pc_init(void)
wchar_t temp[1024];
wchar_t name[128];
const wchar_t *str;
const char *stransi;
/* If no machine selected, force user into Setup Wizard. */
if (machine < 0) {
@@ -851,7 +852,12 @@ pc_init(void)
!video_card_available(video_old_to_new(video_card))) {
/* Whoops, selected video not available. */
str = get_string(IDS_ERR_NOVIDEO);
mbstowcs(name, machine_getname(), sizeof_w(name));
stransi = video_card_getname(video_card);
if (stransi == NULL) {
/* This happens if configured card is not even in table.. */
swprintf(name, sizeof_w(name), L"%i", video_card);
} else
mbstowcs(name, stransi, sizeof_w(name));
swprintf(temp, sizeof_w(temp), str, name);
/* Show the messagebox, and abort if 'No' was selected. */