From dadc646d21d947eeefccf9f8588510858eabca5c Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Windows 11)" <rob@synchro.net> Date: Fri, 3 Jan 2025 21:22:30 -0800 Subject: [PATCH] Don't use/set SM_EURODATE in sys_misc (deprecated), use sys_date_fmt instead Fix off-by-one error in checking TimeZoneComboBox->ItemIndex again tz_val array. When choosing the last (Other/Automatic) item, no change to the sys_timezone should be made (was setting it to 0/UTC). --- src/sbbs3/ctrl/ConfigWizardUnit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sbbs3/ctrl/ConfigWizardUnit.cpp b/src/sbbs3/ctrl/ConfigWizardUnit.cpp index 0d516872bd..c0cbf1f961 100644 --- a/src/sbbs3/ctrl/ConfigWizardUnit.cpp +++ b/src/sbbs3/ctrl/ConfigWizardUnit.cpp @@ -246,7 +246,7 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender) Time24hrRadioButton->Checked=true; else Time12hrRadioButton->Checked=true; - if(scfg.sys_misc&SM_EURODATE) + if(scfg.sys_date_fmt == DDMMYY) DateEuRadioButton->Checked=true; else DateUsRadioButton->Checked=true; @@ -284,7 +284,7 @@ void __fastcall TConfigWizard::NextButtonClick(TObject *Sender) SAFECOPY(scfg.qnet_tagline,QNetTaglineEdit->Text.c_str()); scfg.sys_nodes=NodesUpDown->Position; if(TimeZoneComboBox->ItemIndex>=0 - && TimeZoneComboBox->ItemIndex<=sizeof(tz_val)/sizeof(tz_val[0])) + && TimeZoneComboBox->ItemIndex < sizeof(tz_val)/sizeof(tz_val[0])) scfg.sys_timezone=tz_val[TimeZoneComboBox->ItemIndex]; if(DaylightCheckBox->Checked) scfg.sys_timezone|=DAYLIGHT; @@ -293,9 +293,9 @@ void __fastcall TConfigWizard::NextButtonClick(TObject *Sender) else scfg.sys_misc&=~SM_MILITARY; if(DateEuRadioButton->Checked) - scfg.sys_misc|=SM_EURODATE; + scfg.sys_date_fmt = DDMMYY; else - scfg.sys_misc&=~SM_EURODATE; + scfg.sys_date_fmt = MMDDYY; if(NewUsersCheckBox->Checked) scfg.sys_misc&=~SM_CLOSED; else -- GitLab