mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-29 14:05:22 -04:00
[vhd] fix VHDX being inadvertently saved as VHD
* Addresses the error reported in #2468. * Also use memmove instead of memcpy where overlapping data is involved.
This commit is contained in:
parent
fb43dc8957
commit
45423becd5
3 changed files with 10 additions and 9 deletions
|
@ -1148,8 +1148,9 @@ void VhdSaveImage(void)
|
|||
img_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, &i);
|
||||
if (img_save.ImagePath == NULL)
|
||||
goto out;
|
||||
for (i = 1; i <= (UINT)img_ext.count && (strstr(img_save.ImagePath, &_img_ext_x[i - 1][1]) == NULL); i++);
|
||||
if (i > (UINT)img_ext.count) {
|
||||
// Start from the end of our extension array, since '.vhd' would match for '.vhdx' otherwise
|
||||
for (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &_img_ext_x[i - 1][1]) == NULL); i--);
|
||||
if (i == 0) {
|
||||
uprintf("Warning: Can not determine image type from extension - Saving to uncompressed VHD.");
|
||||
i = image_type_vhd;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue