From cc5a5ef25cb5ab2a3002a54ef3470bb7e32c72ad Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sun, 1 Jan 2017 01:21:25 +0100 Subject: [PATCH] fix(file_util): Type specification Fixes #290 --- src/utils/file.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/file.cpp b/src/utils/file.cpp index c0cb9f63..2461c598 100644 --- a/src/utils/file.cpp +++ b/src/utils/file.cpp @@ -150,10 +150,10 @@ int fd_streambuf::overflow(int c) { int fd_streambuf::underflow() { if (gptr() == egptr()) { - auto pback = std::min(gptr() - eback(), std::ptrdiff_t(m_in)); + std::streamsize pback(std::min(gptr() - eback(), std::ptrdiff_t(m_in))); std::copy(egptr() - pback, egptr(), eback()); - auto bytes = ::read(m_fd, eback() + pback, BUFSIZ); - setg(eback(), eback() + pback, eback() + pback + std::max(0L, bytes)); + int bytes(::read(m_fd, eback() + pback, BUFSIZ)); + setg(eback(), eback() + pback, eback() + pback + std::max(0, bytes)); } return gptr() == egptr() ? traits_type::eof() : traits_type::to_int_type(*gptr()); }