summaryrefslogtreecommitdiff
path: root/src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp')
-rw-r--r--src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp b/src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp
index 0f060321788..6c839399570 100644
--- a/src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp
+++ b/src/third_party/asio-master/asio/include/asio/basic_streambuf.hpp
@@ -2,7 +2,7 @@
// basic_streambuf.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -232,8 +232,7 @@ public:
*/
void commit(std::size_t n)
{
- if (pptr() + n > epptr())
- n = epptr() - pptr();
+ n = std::min<std::size_t>(n, epptr() - pptr());
pbump(static_cast<int>(n));
setg(eback(), gptr(), pptr());
}