forked from len0rd/rockbox
Fix SCSI inquiry on W32.
W32 returns additional bytes containing garbage on pages returning the maximum amount (i.e. 255) of bytes. Ignoring those bytes makes the output being correct. Someone needs to find out why those additional bytes are indicated at all. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22199 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8b77ce2d61
commit
059255705b
1 changed files with 4 additions and 1 deletions
|
|
@ -110,7 +110,10 @@ int ipod_scsi_inquiry(struct ipod_t* ipod, int page_code,
|
|||
FALSE);
|
||||
|
||||
if (status) {
|
||||
memcpy(buf, sptwb.DataBuf, returned);
|
||||
/* W32 sometimes returns more bytes with additional garbage.
|
||||
* Make sure to not copy that garbage. */
|
||||
memcpy(buf, sptwb.DataBuf,
|
||||
(DWORD)bufsize >= returned ? returned : (DWORD)bufsize);
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue