diff options
| -rw-r--r-- | src/file.hh | 2 | ||||
| -rw-r--r-- | src/normal.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/file.hh b/src/file.hh index f5dfa112..5362b342 100644 --- a/src/file.hh +++ b/src/file.hh @@ -115,7 +115,7 @@ struct BufferedWriter while (not data.empty()) { const ByteCount length = data.length(); - const ByteCount write_len = std::min(length, size - m_pos); + const ByteCount write_len = clamp(length, ByteCount{0}, size - m_pos); memcpy(m_buffer + m_pos, data.data(), (int)write_len); m_pos += write_len; if (m_pos == size) diff --git a/src/normal.cc b/src/normal.cc index 96940a90..58013a2e 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -28,6 +28,8 @@ #include "window.hh" #include "word_db.hh" +#include <memory> + namespace Kakoune { |
