mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[misc] prefer strtol/strtoull over atol/atoll
* This means we don't need to worry about conversion issues regarding signedess. In addition, the behavior will no longer be undefined if for some reason the conversion cannot happen. * Closes #2104.
This commit is contained in:
parent
2bc1428975
commit
fab095c043
3 changed files with 8 additions and 8 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));
|
||||||
|
|
|
@ -2479,7 +2479,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++)
|
||||||
|
@ -2521,7 +2521,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));
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.22.1951"
|
CAPTION "Rufus 3.22.1952"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -396,8 +396,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,22,1951,0
|
FILEVERSION 3,22,1952,0
|
||||||
PRODUCTVERSION 3,22,1951,0
|
PRODUCTVERSION 3,22,1952,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -415,13 +415,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://rufus.ie"
|
VALUE "Comments", "https://rufus.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.22.1951"
|
VALUE "FileVersion", "3.22.1952"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.22.exe"
|
VALUE "OriginalFilename", "rufus-3.22.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.22.1951"
|
VALUE "ProductVersion", "3.22.1952"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue