author | Alberto Bertogli
<albertito@gmail.com> 2004-06-05 17:34:20 UTC |
committer | Alberto Bertogli
<albertito@gmail.com> 2007-07-15 13:02:29 UTC |
parent | 069b8bc6faaa8dedf9e72a259c98f62b7216bac8 |
trans.c | +8 | -6 |
diff --git a/trans.c b/trans.c index b250a1c..870c01a 100644 --- a/trans.c +++ b/trans.c @@ -240,22 +240,24 @@ int jtrans_commit(struct jtrans *ts) bufp = buf_init; - memcpy(bufp, (void *) &(ts->id), sizeof(ts->id)); + /* the sizes are put explicitly (instead of using sizeof()) because + * they're really fixed and defined in the on-disk format */ + memcpy(bufp, (void *) &(ts->id), 4); bufp += 4; - memcpy(bufp, (void *) &(ts->flags), sizeof(ts->flags)); + memcpy(bufp, (void *) &(ts->flags), 4); bufp += 4; - memcpy(bufp, (void *) &(ts->len), sizeof(ts->len)); + memcpy(bufp, (void *) &(ts->len), 4); bufp += 4; - memcpy(bufp, (void *) &(ts->plen), sizeof(ts->plen)); + memcpy(bufp, (void *) &(ts->plen), 4); bufp += 4; - memcpy(bufp, (void *) &(ts->ulen), sizeof(ts->ulen)); + memcpy(bufp, (void *) &(ts->ulen), 4); bufp += 4; - memcpy(bufp, (void *) &(ts->offset), sizeof(ts->offset)); + memcpy(bufp, (void *) &(ts->offset), 8); bufp += 8; rv = spwrite(fd, buf_init, J_DISKTFIXSIZE, 0);