projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc9ca23
)
pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
author
Ben Pfaff
<blp@gnu.org>
Mon, 16 Feb 2004 04:52:36 +0000
(
04:52
+0000)
committer
Ben Pfaff
<blp@gnu.org>
Mon, 16 Feb 2004 04:52:36 +0000
(
04:52
+0000)
undefined behavior.
src/ChangeLog
patch
|
blob
|
history
src/pfm-write.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index 0c7b9fb1d7acabc7267ce892b165df29bd9f7eae..64185402caa1eb71a7c6560ae289c865fac1f693 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,3
+1,8
@@
+Sun Feb 15 20:50:36 2004 Ben Pfaff <blp@gnu.org>
+
+ * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
+ undefined behavior.
+
Thu Feb 12 23:35:15 2004 Ben Pfaff <blp@gnu.org>
Add auxiliary argument to procedure() interface. Associated small
Thu Feb 12 23:35:15 2004 Ben Pfaff <blp@gnu.org>
Add auxiliary argument to procedure() interface. Associated small
diff --git
a/src/pfm-write.c
b/src/pfm-write.c
index cf815e4f8064b1766408b3d7bcadfb524804f713..359f0440159480c26d9d40264ccc1079e85bb232 100644
(file)
--- 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
/* 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);
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;
goto lossage;
nbytes -= n;
-
*((char **) &buf)
+= n;
+
buf
+= n;
ext->lc = 0;
}
ext->lc = 0;
}