1
0
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:
drh
2007-01-05 14:38:54 +00:00
parent 24c9a2eeb2
commit aedd892e0c
4 changed files with 11 additions and 13 deletions

View File

@@ -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;