Fixed hdimage lock file handling in the USB MSD case.

- Store file name string instead of pointer to file name.
- Increased size of the info text to fix a warning,
This commit is contained in:
Volker Ruppert 2020-01-03 21:17:15 +00:00
parent 694112732b
commit acac6ecf45
2 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
//
// Copyright (c) 2006 CodeSourcery.
// Written by Paul Brook
// Copyright (C) 2009-2018 The Bochs Project
// Copyright (C) 2009-2020 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -356,17 +356,17 @@ usb_msd_device_c::usb_msd_device_c(usbdev_type type, const char *filename)
ptr2 = strtok(NULL, ":");
if ((ptr2 == NULL) || (strlen(ptr1) < 2)) {
s.image_mode = BX_HDIMAGE_MODE_FLAT;
s.fname = filename;
strcpy(s.fname, filename);
} else {
s.image_mode = SIM->hdimage_get_mode(ptr1);
s.fname = filename+strlen(ptr1)+1;
strcpy(s.fname, filename+strlen(ptr1)+1);
}
s.journal[0] = 0;
s.size = 0;
s.sect_size = 512;
} else if (d.type == USB_DEV_TYPE_CDROM) {
strcpy(d.devname, "BOCHS USB CDROM");
s.fname = filename;
strcpy(s.fname, filename);
// config options
bx_list_c *usb_rt = (bx_list_c*)SIM->get_param(BXPN_MENU_RUNTIME_USB);
sprintf(pname, "cdrom%d", ++usb_cdrom_count);

View File

@ -6,7 +6,7 @@
//
// Copyright (c) 2006 CodeSourcery.
// Written by Paul Brook
// Copyright (C) 2009-2018 The Bochs Project
// Copyright (C) 2009-2020 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -64,9 +64,9 @@ private:
cdrom_base_c *cdrom;
scsi_device_t *scsi_dev;
bx_list_c *sr_list;
const char *fname;
char fname[BX_PATHNAME_LEN];
bx_list_c *config;
char info_txt[BX_PATHNAME_LEN];
char info_txt[BX_PATHNAME_LEN + 38];
char journal[BX_PATHNAME_LEN]; // undoable / volatile disk only
int size; // VVFAT disk only
unsigned sect_size; // sector size for disks only (default = 512 bytes)