diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-28 17:34:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-28 17:34:57 +0000 |
commit | f1b1e3ba11994bcbb0a1ddad9f8e686a6a9ae475 (patch) | |
tree | fb9adb1354dc4750e3c3ac80e0f36cfd47c9e95c /nuttx/drivers/usbdev | |
parent | 9d573948f4778bcb167e9a2a083bba35f339affd (diff) | |
download | px4-nuttx-f1b1e3ba11994bcbb0a1ddad9f8e686a6a9ae475.tar.gz px4-nuttx-f1b1e3ba11994bcbb0a1ddad9f8e686a6a9ae475.tar.bz2 px4-nuttx-f1b1e3ba11994bcbb0a1ddad9f8e686a6a9ae475.zip |
Fixes to STM32 SPI, USB MSC class driver, and MMC/SD SPI driver from Petteri Aimonen
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5688 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbdev')
-rw-r--r-- | nuttx/drivers/usbdev/usbmsc_scsi.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nuttx/drivers/usbdev/usbmsc_scsi.c b/nuttx/drivers/usbdev/usbmsc_scsi.c index ccc967618..ff551871c 100644 --- a/nuttx/drivers/usbdev/usbmsc_scsi.c +++ b/nuttx/drivers/usbdev/usbmsc_scsi.c @@ -607,15 +607,27 @@ static inline int usbmsc_cmdinquiry(FAR struct usbmsc_dev_s *priv, memset(response->vendorid, ' ', 8+16+4); len = strlen(g_mscvendorstr); - DEBUGASSERT(len <= 8); + if (len > 8) + { + len = 8; + } + memcpy(response->vendorid, g_mscvendorstr, len); len = strlen(g_mscproductstr); - DEBUGASSERT(len <= 16); + if (len > 16) + { + len = 16; + } + memcpy(response->productid, g_mscproductstr, len); len = strlen(g_mscserialstr); - DEBUGASSERT(len <= 4); + if (len > 4) + { + len = 4; + } + memcpy(response->revision, g_mscserialstr, len); } } |