Made sure cdrom_image.c doesn't strcpy() from the same place to the same place.

This commit is contained in:
OBattler
2021-08-26 10:14:27 +02:00
parent d9ac4ea75f
commit 6d7acaa100

View File

@@ -253,7 +253,10 @@ cdrom_image_open(cdrom_t *dev, const char *fn)
{
cd_img_t *img;
strcpy(dev->image_path, fn);
/* Make sure to not STRCPY if the two are pointing
at the same place. */
if (fn != dev->image_path)
strcpy(dev->image_path, fn);
/* Create new instance of the CDROM_Image class. */
img = (cd_img_t *) malloc(sizeof(cd_img_t));