MCPcopy Create free account
hub / github.com/avast/retdec / writeRepeatingByte

Method writeRepeatingByte

src/utils/dynamic_buffer.cpp:254–266  ·  view source on GitHub ↗

* Writes the single byte into the buffer for repeating amount of times. * * @param byte The byte to write into the buffer. * @param pos The position where to start writing the byte. * @param repeatAmount The number of times the byte is written into the * buffer starting from pos including. */

Source from the content-addressed store, hash-verified

252 * buffer starting from pos including.
253 */
254void DynamicBuffer::writeRepeatingByte(
255 uint8_t byte,
256 uint32_t pos,
257 uint32_t repeatAmount)
258{
259 if (pos + repeatAmount > _capacity)
260 repeatAmount = _capacity - pos;
261
262 if (pos + repeatAmount > _data.size())
263 _data.resize(pos + repeatAmount);
264
265 memset(&_data[pos], byte, repeatAmount);
266}
267
268} // namespace unpacker
269} // namespace retdec

Callers 1

fixImportsAndEpMethod · 0.80

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected