Optimize vendor/product description string display code in MassStorageHost.
[pub/lufa.git] / Demos / Host / LowLevel / MassStorageHost / MassStorageHost.c
index a1febf2..200c81a 100644 (file)
@@ -223,18 +223,9 @@ void MassStorage_Task(void)
                                ShowDiskReadError(PSTR("Inquiry"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);\r
                                break;\r
                        }\r
-                       \r
-                       /* VendorID and ProductID are fixed-length non-null terminated strings - need to terminate them before displaying */\r
-                       char VendorID[9];\r
-                       char ProductID[17];\r
-                       \r
-                       memcpy(&VendorID, &InquiryData.VendorID, 8);\r
-                       memcpy(&ProductID, &InquiryData.ProductID, 16);\r
-                       VendorID[8]   = 0x00;\r
-                       ProductID[16] = 0x00;\r
 \r
                        /* Print vendor and product names of attached device */\r
-                       printf_P(PSTR("Vendor \"%s\", Product \"%s\"\r\n"), VendorID, ProductID);\r
+                       printf_P(PSTR("Vendor \"%.8s\", Product \"%.16s\"\r\n"), InquiryData.VendorID, InquiryData.ProductID);\r
                                                \r
                        /* Wait until disk ready */\r
                        puts_P(PSTR("Waiting until ready.."));\r