httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor J. Orlikowski" <...@raleigh.ibm.com>
Subject [PATCH] Pointer arithmetic patch
Date Mon, 17 Jul 2000 19:57:31 GMT
Pointer arithmetic on void * is bad, mmm-kay? Casting to char *.
#$#@ ezmlm doesn't like my normal X-Sender.....

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);



Mime
View raw message