Use MemBuffer.clear().

committer: mfx <mfx> 1043693892 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2003-01-27 18:58:12 +00:00
parent 51c28020de
commit ac4b8f8617
3 changed files with 25 additions and 21 deletions
+3 -3
View File
@@ -301,7 +301,7 @@ void PackPs1::pack(OutputFile *fo)
// prepare paddata
MemBuffer paddata(PS_HDR_SIZE);
memset(paddata, 0, paddata.getSize());
paddata.clear();
// write loader + compressed file
fo->write(&oh, sizeof(oh));
@@ -392,10 +392,10 @@ void PackPs1::unpack(OutputFile *fo)
// write header
fo->write(&oh, sizeof(oh));
// align the ps exe header (mode 2 sector data size)
memset(ibuf, 0, PS_HDR_SIZE - sizeof(oh));
ibuf.clear(0, PS_HDR_SIZE - sizeof(oh));
fo->write(ibuf, PS_HDR_SIZE - sizeof(oh));
// write uncompressed data + pad
memset(obuf + ph.u_len, 0, pad);
obuf.clear(ph.u_len, pad);
fo->write(obuf, ph.u_len + pad);
}
}