summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2019-11-25 11:34:39 +0100
committerFrank LENORMAND <lenormf@gmail.com>2019-11-25 11:34:39 +0100
commit7512f5eae63e721a7abb51985cbecaf41af94121 (patch)
treeb7c6e9dbe77c1c8fec9db47f2591dbc71fa11f55 /src/normal.cc
parent7b3ab2378081fee6a9a4fd3c2790bd80dc16e35e (diff)
src: Use `begin()` to get iterators
When compiling the code with `-Wp,-D_GLIBCXX_ASSERTIONS`, the process gets aborted, likely because iterators to standard containers are not obtained in a safe way. Fixes #3226.
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 1b287e5f..fd46dab9 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -512,7 +512,7 @@ BufferCoord apply_diff(Buffer& buffer, BufferCoord pos, StringView before, Strin
lines_after.begin(), (int)lines_after.size());
auto byte_count = [](auto&& lines, int first, int count) {
- return std::accumulate(&lines[first], &lines[first+count], 0_byte,
+ return std::accumulate(lines.begin() + first, lines.begin() + first + count, 0_byte,
[](ByteCount l, StringView s) { return l + s.length(); });
};