mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-16 23:02:26 +03:00
Suppress compiler warnings. Fix a bug in IO error detection on windows. (CVS 3564)
FossilOrigin-Name: daed2bab00ea3952d2d4e5182ca07653b9d80ac2
This commit is contained in:
@@ -1003,12 +1003,10 @@ static int winRead(OsFile *id, void *pBuf, int amt){
|
||||
SimulateIOError(return SQLITE_IOERR);
|
||||
TRACE3("READ %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
|
||||
if( !ReadFile(((winFile*)id)->h, pBuf, amt, &got, 0) ){
|
||||
got = -1;
|
||||
return SQLITE_IOERR_READ;
|
||||
}
|
||||
if( got==(DWORD)amt ){
|
||||
return SQLITE_OK;
|
||||
}else if( got<0 ){
|
||||
return SQLITE_IOERR_READ;
|
||||
}else{
|
||||
memset(&((char*)pBuf)[got], 0, amt-got);
|
||||
return SQLITE_IOERR_SHORT_READ;
|
||||
|
||||
Reference in New Issue
Block a user