apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r584480 - /apr/apr/trunk/file_io/win32/seek.c
Date Sun, 14 Oct 2007 02:53:28 GMT
Author: wrowe
Date: Sat Oct 13 19:53:27 2007
New Revision: 584480

URL: http://svn.apache.org/viewvc?rev=584480&view=rev
Log:
Fix bug identified by testlfs; Win32 didn't handle buffered
files >size_t bytes (we cast-truncated at the wrong spot).

Modified:
    apr/apr/trunk/file_io/win32/seek.c

Modified: apr/apr/trunk/file_io/win32/seek.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/seek.c?rev=584480&r1=584479&r2=584480&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/seek.c (original)
+++ apr/apr/trunk/file_io/win32/seek.c Sat Oct 13 19:53:27 2007
@@ -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 @@
     /* 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;



Mime
View raw message