You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2005/09/01 19:19:12 UTC

svn commit: r265757 - /apr/apr/trunk/file_io/win32/seek.c

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;