From: Ben Pfaff Date: Mon, 16 Feb 2004 04:52:36 +0000 (+0000) Subject: pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked X-Git-Tag: v0.4.0~360 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51fdaa7f712da722aa8bcaa972a3091f7932e53c;p=pspp-builds.git pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked undefined behavior. --- diff --git a/src/ChangeLog b/src/ChangeLog index 0c7b9fb1..64185402 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Sun Feb 15 20:50:36 2004 Ben Pfaff + + * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked + undefined behavior. + Thu Feb 12 23:35:15 2004 Ben Pfaff Add auxiliary argument to procedure() interface. Associated small diff --git a/src/pfm-write.c b/src/pfm-write.c index cf815e4f..359f0440 100644 --- a/src/pfm-write.c +++ b/src/pfm-write.c @@ -136,8 +136,9 @@ lossage: /* Write NBYTES starting at BUF to the portable file represented by H. Break lines properly every 80 characters. */ static int -bufwrite (struct file_handle *h, const void *buf, size_t nbytes) +bufwrite (struct file_handle *h, const void *buf_, size_t nbytes) { + const char *buf = buf_; struct pfm_fhuser_ext *ext = h->ext; assert (buf != NULL); @@ -153,7 +154,7 @@ bufwrite (struct file_handle *h, const void *buf, size_t nbytes) goto lossage; nbytes -= n; - *((char **) &buf) += n; + buf += n; ext->lc = 0; }