apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r584582 - /apr/apr/branches/1.2.x/file_io/win32/seek.c
Date Sun, 14 Oct 2007 19:12:35 GMT
Author: wrowe
Date: Sun Oct 14 12:12:34 2007
New Revision: 584582

URL: http://svn.apache.org/viewvc?rev=584582&view=rev
Log:
Here is the correct cast for signed-ness where size_t is off_t
bytes long, while size_t is unsigned and off_t is usually signed.
This is true of Windows/x64

This solves the emit without causing truncation, we have the
assumption that off_t can't possibly be smaller than size_t
(or how would one have a swapfile :)

Modified:
    apr/apr/branches/1.2.x/file_io/win32/seek.c

Modified: apr/apr/branches/1.2.x/file_io/win32/seek.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/win32/seek.c?rev=584582&r1=584581&r2=584582&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/seek.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/seek.c Sun Oct 14 12:12:34 2007
@@ -39,7 +39,7 @@
      */
     newbufpos = pos - (thefile->filePtr - thefile->dataRead);
 
-    if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
+    if (newbufpos >= 0 && newbufpos <= (apr_off_t)thefile->dataRead) {
         thefile->bufpos = (apr_size_t)newbufpos;
         rv = APR_SUCCESS;
     } else {



Mime
View raw message