Fix a potential crash

pull/16/head
Timothy Pearson 13 years ago
parent 667932498f
commit c7e94c427a

@ -930,9 +930,9 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
|| (sdevice->isDiskOfType(TDEDiskDeviceType::DVDVideo)) || (sdevice->isDiskOfType(TDEDiskDeviceType::DVDVideo))
|| (sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo)) || (sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo))
) { ) {
if (disklabel == "") { if (disklabel == "" && sdevice->diskLabel().isNull()) {
// Read the volume label in via volname, since udev couldn't be bothered to do this on its own // Read the volume label in via volname, since udev couldn't be bothered to do this on its own
FILE *exepipe = popen((TQString("volname %1").arg(devicenode).ascii()), "r"); FILE *exepipe = popen(((TQString("volname %1").arg(devicenode).ascii())), "r");
if (exepipe) { if (exepipe) {
char buffer[8092]; char buffer[8092];
disklabel = fgets(buffer, sizeof(buffer), exepipe); disklabel = fgets(buffer, sizeof(buffer), exepipe);

Loading…
Cancel
Save