1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[misc] fix warnings reported by Cppcheck

* Closes #1520
This commit is contained in:
Pete Batard 2020-05-08 01:25:35 +01:00
parent 79a6f8942e
commit bcca9144b7
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 8 additions and 14 deletions

View file

@ -427,13 +427,12 @@ static unsigned int test_rw(HANDLE hDrive, blk64_t last_block, size_t block_size
} }
buffer = allocate_buffer(2 * blocks_at_once * block_size); buffer = allocate_buffer(2 * blocks_at_once * block_size);
read_buffer = buffer + blocks_at_once * block_size;
if (!buffer) { if (!buffer) {
uprintf("%sError while allocating buffers\n", bb_prefix); uprintf("%sError while allocating buffers\n", bb_prefix);
cancel_ops = -1; cancel_ops = -1;
return 0; return 0;
} }
read_buffer = buffer + blocks_at_once * block_size;
uprintf("%sChecking from block %lu to %lu (1 block = %s)\n", bb_prefix, uprintf("%sChecking from block %lu to %lu (1 block = %s)\n", bb_prefix,
(unsigned long) first_block, (unsigned long) last_block - 1, (unsigned long) first_block, (unsigned long) last_block - 1,

View file

@ -1391,9 +1391,6 @@ static BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp)
return FALSE; return FALSE;
} }
Sleep(200); Sleep(200);
}
if (use_esp) {
// Need to have the ESP mounted to invoke bcdboot // Need to have the ESP mounted to invoke bcdboot
ms_efi = AltMountVolume(DriveIndex, partition_offset[PI_ESP], FALSE); ms_efi = AltMountVolume(DriveIndex, partition_offset[PI_ESP], FALSE);
if (ms_efi == NULL) { if (ms_efi == NULL) {

View file

@ -280,10 +280,8 @@ BOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LP
uprintf("ext4 file system is not supported, defaulting to ext3"); uprintf("ext4 file system is not supported, defaulting to ext3");
else else
uprintf("Invalid ext file system version requested, defaulting to ext3"); uprintf("Invalid ext file system version requested, defaulting to ext3");
}
if ((strcmp(FSName, FileSystemLabel[FS_EXT2]) != 0) && (strcmp(FSName, FileSystemLabel[FS_EXT3]) != 0))
FSName = FileSystemLabel[FS_EXT3]; FSName = FileSystemLabel[FS_EXT3];
}
PrintInfoDebug(0, MSG_222, FSName); PrintInfoDebug(0, MSG_222, FSName);
UpdateProgressWithInfoInit(NULL, TRUE); UpdateProgressWithInfoInit(NULL, TRUE);

View file

@ -753,7 +753,7 @@ BOOL EnablePrivileges(void)
if (NT_SUCCESS(status)) { if (NT_SUCCESS(status)) {
CHAR privilegesBuffer[FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges) + CHAR privilegesBuffer[FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges) +
sizeof(LUID_AND_ATTRIBUTES) * ARRAYSIZE(requestedPrivileges)]; sizeof(LUID_AND_ATTRIBUTES) * ARRAYSIZE(requestedPrivileges)] = { 0 };
PTOKEN_PRIVILEGES privileges; PTOKEN_PRIVILEGES privileges;
ULONG i; ULONG i;

View file

@ -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.10.1652" CAPTION "Rufus 3.10.1653"
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
@ -395,8 +395,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,10,1652,0 FILEVERSION 3,10,1653,0
PRODUCTVERSION 3,10,1652,0 PRODUCTVERSION 3,10,1653,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -414,13 +414,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.10.1652" VALUE "FileVersion", "3.10.1653"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2020 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.10.exe" VALUE "OriginalFilename", "rufus-3.10.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.10.1652" VALUE "ProductVersion", "3.10.1653"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"