diff options
author | pweilbacher <pweilbacher@noemail.net> | 2007-01-28 21:12:13 +0000 |
---|---|---|
committer | pweilbacher <pweilbacher@noemail.net> | 2007-01-28 21:12:13 +0000 |
commit | 4a53cdbc34a55cf344334db2af0c7cf0a8feaf1f (patch) | |
tree | a3386ee3aae320adb60d39f44650fb34c551bcd1 /src | |
parent | 800c50efd9743d3e9270c7ffc58616fa9ba533ac (diff) | |
download | sqlite-4a53cdbc34a55cf344334db2af0c7cf0a8feaf1f.tar.gz sqlite-4a53cdbc34a55cf344334db2af0c7cf0a8feaf1f.zip |
Adapt returns of the os2Read() function to those of other platforms using checkin (3549) to prevent possible corruption (CVS 3617)
FossilOrigin-Name: ba76107cd1fc1898f5357b20b339727e2e034e23
Diffstat (limited to 'src')
-rw-r--r-- | src/os_os2.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os_os2.c b/src/os_os2.c index 0a008e183..b127957c0 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -296,7 +296,14 @@ int os2Read( OsFile *id, void *pBuf, int amt ){ SimulateIOError( return SQLITE_IOERR ); TRACE3( "READ %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype ); DosRead( ((os2File*)id)->h, pBuf, amt, &got ); - return (got == (ULONG)amt) ? SQLITE_OK : SQLITE_IOERR_SHORT_READ; + if (got == (ULONG)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; + } } /* |