It might leak data depending on what's in the buffer. Use pad() instead
where blank space is needed.
while (bytes-- > 0) writeU8(0);
}
- inline void skip(size_t bytes) {
- while (bytes > 0) {
- size_t n = check(1, bytes);
- ptr += n;
- bytes -= n;
- }
- }
-
// writeBytes() writes an exact number of bytes.
void writeBytes(const void* data, size_t length) {
{
std::list<rdr::U32>::const_iterator iter;
startMsg(msgTypeSetEncodings);
- os->skip(1);
+ os->pad(1);
os->writeU16(encodings.size());
for (iter = encodings.begin(); iter != encodings.end(); ++iter)
os->writeU32(*iter);