mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
Use strtol over atol
As well as strtoull over atoll and then cast to uint64_t
This commit is contained in:
parent
ddcbe8ed81
commit
2d3871957f
2 changed files with 3 additions and 3 deletions
|
@ -428,7 +428,7 @@ uint64_t DownloadToFileOrBuffer(const char* url, const char* file, BYTE** buffer
|
||||||
uprintf("Unable to retrieve file length: %s", WinInetErrorString());
|
uprintf("Unable to retrieve file length: %s", WinInetErrorString());
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
total_size = (uint64_t)atoll(strsize);
|
total_size = strtoull(strsize, NULL, 10);
|
||||||
if (hProgressDialog != NULL) {
|
if (hProgressDialog != NULL) {
|
||||||
char msg[128];
|
char msg[128];
|
||||||
uprintf("File length: %s", SizeToHumanReadable(total_size, FALSE, FALSE));
|
uprintf("File length: %s", SizeToHumanReadable(total_size, FALSE, FALSE));
|
||||||
|
|
|
@ -2478,7 +2478,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GetWindowTextA(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));
|
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_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));
|
||||||
persistence_size = lPos * MB;
|
persistence_size = lPos * MB;
|
||||||
for (i = 0; i < persistence_unit_selection; i++)
|
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)
|
if (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS)) == persistence_unit_selection)
|
||||||
break;
|
break;
|
||||||
GetWindowTextA(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));
|
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++)
|
for (i = 0; i < persistence_unit_selection; i++)
|
||||||
persistence_size *= 1024;
|
persistence_size *= 1024;
|
||||||
persistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));
|
persistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue