Преглед изворни кода

Ensure during config loading the image index is set properly.

scsiDiskResetImages() does a memset to 0 during reinit so default values need to be handled here.
saybur пре 2 година
родитељ
комит
f9d6571027
2 измењених фајлова са 3 додато и 2 уклоњено
  1. 1 0
      src/BlueSCSI_disk.cpp
  2. 2 2
      src/BlueSCSI_disk.h

+ 1 - 0
src/BlueSCSI_disk.cpp

@@ -593,6 +593,7 @@ void scsiDiskLoadConfig(int target_idx)
     // Check if we have image specified by name
     char filename[MAX_FILE_PATH];
     image_config_t &img = g_DiskImages[target_idx];
+    img.image_index = IMAGE_INDEX_MAX;
     if (scsiDiskGetNextImageName(img, filename, sizeof(filename)))
     {
         int blocksize = (img.deviceType == S2S_CFG_OPTICAL) ? 2048 : 512;

+ 2 - 2
src/BlueSCSI_disk.h

@@ -67,9 +67,9 @@ struct image_config_t: public S2S_TargetCfg
     // True if there is a subdirectory of images for this target
     bool image_directory;
     // the name of the currently mounted image in a dynamic image directory
-    char current_image[MAX_FILE_PATH] = {'\0'};
+    char current_image[MAX_FILE_PATH];
     // Index of image, for when image on-the-fly switching is used for CD drives
-    uint8_t image_index = IMAGE_INDEX_MAX;
+    uint8_t image_index;
 
     // Cue sheet file for CD-ROM images
     FsFile cuesheetfile;