Skip to content

Commit

Permalink
Moved dir declaration inside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicScale authored Jan 1, 2025
1 parent ce3a9f0 commit 7d54d56
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/opl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1953,14 +1953,13 @@ static void autoLaunchBDMGame(char *argv[])
gAutoLaunchDeviceData = malloc(sizeof(bdm_device_data_t));
memset(gAutoLaunchDeviceData, 0, sizeof(bdm_device_data_t));

int dir = -1;
char apaDevicePrefix[8] = {0};
delay(8);
snprintf(apaDevicePrefix, sizeof(apaDevicePrefix), "mass0:");
// Loop through mass0: to mass4:
for (int i = 0; i <= 4; i++) {
snprintf(path, sizeof(path), "mass%d:", i);
dir = fileXioDopen(path);
int dir = fileXioDopen(path);

if (dir >= 0) {
fileXioIoctl2(dir, USBMASS_IOCTL_GET_DRIVERNAME, NULL, 0, &gAutoLaunchDeviceData->bdmDriver, sizeof(gAutoLaunchDeviceData->bdmDriver) - 1);
Expand Down

0 comments on commit 7d54d56

Please sign in to comment.