[misc] fix coverity warnings in drive.c

* Also apply minor fixes to rufus.loc and _set_git_hooks.sh
This commit is contained in:
Pete Batard 2018-05-15 10:23:45 +01:00
parent 6513b5e0b4
commit 4a8c5be9c5
4 changed files with 12 additions and 11 deletions

View file

@ -794,9 +794,10 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
// Check the FAT label to see if we're dealing with an UEFI_NTFS partition
buf = calloc(SelectedDrive.SectorSize, 1);
if (buf != NULL) {
SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset, NULL, FILE_BEGIN);
ReadFile(hPhysical, buf, SelectedDrive.SectorSize, &size, NULL);
isUefiNtfs = (strncmp(&buf[0x2B], "UEFI_NTFS", 9) == 0);
if (SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset, NULL, FILE_BEGIN) &&
ReadFile(hPhysical, buf, SelectedDrive.SectorSize, &size, NULL)) {
isUefiNtfs = (strncmp(&buf[0x2B], "UEFI_NTFS", 9) == 0);
}
free(buf);
}
}