You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Victor J. Orlikowski" <v....@gte.net> on 2000/07/17 20:57:46 UTC

[PATCH] Pointer arithmetic fix.

Pointer arithmeic n a void * is bad, mmm-kay. Casting to a char *.

Index: src/lib/apr/file_io/unix/fullrw.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/file_io/unix/fullrw.c,v
retrieving revision 1.1
diff -u -r1.1 fullrw.c
--- fullrw.c    2000/07/15 02:07:20     1.1
+++ fullrw.c    2000/07/17 18:49:15
@@ -65,7 +65,7 @@
        ap_ssize_t amt = (ap_ssize_t)nbytes;

        status = ap_read(thefile, buf, &amt);
-       buf += amt;
+       buf = (char *)buf + amt;
         nbytes -= amt;
         total_read += amt;
     } while (status == APR_SUCCESS && nbytes > 0);
@@ -86,7 +86,7 @@
        ap_ssize_t amt = (ap_ssize_t)nbytes;

        status = ap_write(thefile, buf, &amt);
-       buf += amt;
+       buf = (char *)buf + amt;
         nbytes -= amt;
         total_written += amt;
     } while (status == APR_SUCCESS && nbytes > 0);

-- 
Victor J. Orlikowski            v.j.orlikowski@gte.net
                                vjo@raleigh.ibm.com
                                vjo@us.ibm.com