2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 14:35:29 +00:00

[2369] Fix vector::erase() call in InputSource

The single-argument variant of vector::erase() deletes just one element
of the vector, not an entire range.  Tests have been fixed to check
that the range from start to the current buffer position is dropped
correctly.
This commit is contained in:
Mukund Sivaraman
2012-10-31 12:42:02 +05:30
parent 51e26dc96b
commit ba71154440
2 changed files with 8 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ InputSource::compact() {
if (buffer_pos_ == buffer_.size()) {
buffer_.clear();
} else {
buffer_.erase(buffer_.begin() + buffer_pos_);
buffer_.erase(buffer_.begin(), buffer_.begin() + buffer_pos_);
}
buffer_pos_ = 0;