Use strtol over atol

This is safer to use.
This commit is contained in:
Rose 2022-12-05 12:00:24 -05:00 committed by GitHub
parent 602a916e75
commit 8f66a9c1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2478,7 +2478,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
break;
}
GetWindowTextA(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));
lPos = atol(tmp);
lPos = strtol(tmp, NULL, 10);
persistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));
persistence_size = lPos * MB;
for (i = 0; i < persistence_unit_selection; i++)
@ -2520,7 +2520,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
if (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS)) == persistence_unit_selection)
break;
GetWindowTextA(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));
persistence_size = atol(tmp) * MB;
persistence_size = strtol(tmp, NULL, 10) * MB;
for (i = 0; i < persistence_unit_selection; i++)
persistence_size *= 1024;
persistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));