apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r265757 - /apr/apr/trunk/file_io/win32/seek.c
Date Thu, 01 Sep 2005 17:19:12 GMT
Author: wrowe
Date: Thu Sep  1 10:19:07 2005
New Revision: 265757

URL: http://svn.apache.org/viewcvs?rev=265757&view=rev
Log:

  Fix an extranious emit, the file is huge (off_t) but the
  newbufpos is an offset in memory (size_t).

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

Modified: apr/apr/trunk/file_io/win32/seek.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/win32/seek.c?rev=265757&r1=265756&r2=265757&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/seek.c (original)
+++ apr/apr/trunk/file_io/win32/seek.c Thu Sep  1 10:19:07 2005
@@ -30,7 +30,11 @@
         thefile->direction = 0;
     }
 
-    newbufpos = pos - (thefile->filePtr - thefile->dataRead);
+    /* 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));
 
     if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
         thefile->bufpos = (apr_size_t)newbufpos;



Mime
View raw message