From 8ad8d1e2f9b4aef2a9c27de8abe8b6a11558c668 Mon Sep 17 00:00:00 2001 From: TomW Date: Tue, 8 Jul 2014 21:03:34 +0100 Subject: [PATCH] Fixed crash when selecting no sound card. Fixed number of heads when creating a new hard disc for drive C. --- src/sound.c | 2 ++ src/win-hdconf.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sound.c b/src/sound.c index 99310cd..d47380a 100644 --- a/src/sound.c +++ b/src/sound.c @@ -63,6 +63,8 @@ device_t *sound_card_getdevice(int card) int sound_card_has_config(int card) { + if (!sound_cards[card].device) + return 0; return sound_cards[card].device->config ? 1 : 0; } diff --git a/src/win-hdconf.c b/src/win-hdconf.c index 30450df..576d992 100644 --- a/src/win-hdconf.c +++ b/src/win-hdconf.c @@ -331,7 +331,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR h = GetDlgItem(hdlg, IDC_EDIT_C_SPT); sprintf(s, "%i", hd_new_spt); SendMessage(h, WM_SETTEXT, 0, (LPARAM)s); - h = GetDlgItem(hdlg, IDC_EDIT_C_CYL); + h = GetDlgItem(hdlg, IDC_EDIT_C_HPC); sprintf(s, "%i", hd_new_hpc); SendMessage(h, WM_SETTEXT, 0, (LPARAM)s); h = GetDlgItem(hdlg, IDC_EDIT_C_CYL);