httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor J. Orlikowski" <v.j.orlikow...@gte.net>
Subject [PATCH] Pointer arithmetic fix.
Date Mon, 17 Jul 2000 18:57:46 GMT
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


Mime
View raw message