X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/b2cf4d32221075c96a7487b1fc0baa2598d373fe..23f3c3deee8bd153d59f2ac4e659c71ee75915f7:/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c index a1febf204..2f84d0fb8 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c @@ -223,18 +223,9 @@ void MassStorage_Task(void) ShowDiskReadError(PSTR("Inquiry"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); break; } - - /* VendorID and ProductID are fixed-length non-null terminated strings - need to terminate them before displaying */ - char VendorID[9]; - char ProductID[17]; - - memcpy(&VendorID, &InquiryData.VendorID, 8); - memcpy(&ProductID, &InquiryData.ProductID, 16); - VendorID[8] = 0x00; - ProductID[16] = 0x00; /* Print vendor and product names of attached device */ - printf_P(PSTR("Vendor \"%s\", Product \"%s\"\r\n"), VendorID, ProductID); + printf_P(PSTR("Vendor \"%.8s\", Product \"%.16s\"\r\n"), InquiryData.VendorID, InquiryData.ProductID); /* Wait until disk ready */ puts_P(PSTR("Waiting until ready..")); @@ -358,9 +349,9 @@ void MassStorage_Task(void) * printing error codes to the serial port and waiting until the device is removed before * continuing. * - * \param CommandString ASCII string located in PROGMEM space indicating what operation failed - * \param FailedAtSCSILayer Indicates if the command failed at the (logical) SCSI layer or at the physical USB layer - * \param ErrorCode Error code of the function which failed to complete successfully + * \param[in] CommandString ASCII string located in PROGMEM space indicating what operation failed + * \param[in] FailedAtSCSILayer Indicates if the command failed at the (logical) SCSI layer or at the physical USB layer + * \param[in] ErrorCode Error code of the function which failed to complete successfully */ void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t ErrorCode) {