Commit 62a00e33 authored by Victor Zverovich's avatar Victor Zverovich

Fix more "secure" warnings.

parent f211e313
...@@ -142,7 +142,7 @@ void Array<T, SIZE>::append(const T *begin, const T *end) { ...@@ -142,7 +142,7 @@ void Array<T, SIZE>::append(const T *begin, const T *end) {
std::ptrdiff_t num_elements = end - begin; std::ptrdiff_t num_elements = end - begin;
if (size_ + num_elements > capacity_) if (size_ + num_elements > capacity_)
Grow(num_elements); Grow(num_elements);
std::copy(begin, end, ptr_ + size_); std::copy(begin, end, CheckIterator(ptr_ + size_, capacity_ - size_));
size_ += num_elements; size_ += num_elements;
} }
...@@ -1533,7 +1533,8 @@ void BasicFormatter<Char>::DoFormat() { ...@@ -1533,7 +1533,8 @@ void BasicFormatter<Char>::DoFormat() {
if (spec.width_ > 1) { if (spec.width_ > 1) {
out = this->GrowBuffer(spec.width_); out = this->GrowBuffer(spec.width_);
if (spec.align_ == ALIGN_RIGHT) { if (spec.align_ == ALIGN_RIGHT) {
std::fill_n(out, spec.width_ - 1, spec.fill_); std::fill_n(internal::CheckIterator(out, spec.width_),
spec.width_ - 1, spec.fill_);
out += spec.width_ - 1; out += spec.width_ - 1;
} else if (spec.align_ == ALIGN_CENTER) { } else if (spec.align_ == ALIGN_CENTER) {
out = this->FillPadding(out, spec.width_, 1, spec.fill_); out = this->FillPadding(out, spec.width_, 1, spec.fill_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment