* 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. */
| 252 | * buffer starting from pos including. |
| 253 | */ |
| 254 | void 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 |
no test coverage detected