diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-14 02:53:27 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-14 02:53:27 +0000 |
commit | 6270ac116ab7d80b3eb0596990f73276adcd135c (patch) | |
tree | e3919d566dba196e37d7b0338813b4836799248a /file_io/win32/seek.c | |
parent | 60427f299181e86e8438ced4ea89524182183e06 (diff) | |
download | libapr-6270ac116ab7d80b3eb0596990f73276adcd135c.tar.gz |
Fix bug identified by testlfs; Win32 didn't handle buffered
files >size_t bytes (we cast-truncated at the wrong spot).
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@584480 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/win32/seek.c')
-rw-r--r-- | file_io/win32/seek.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index daa48cf0f..abebde85d 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -21,7 +21,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { - apr_size_t newbufpos; + apr_off_t newbufpos; apr_status_t rv; DWORD rc; @@ -37,8 +37,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) /* We may be truncating to size here. * XXX: testing an 'unsigned' as >= 0 below indicates a bug */ - newbufpos = (apr_size_t)(pos - (thefile->filePtr - - thefile->dataRead)); + newbufpos = pos - (thefile->filePtr - thefile->dataRead); if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = (apr_size_t)newbufpos; |