From 31b59f0b0fe027ac9df930bdbe51f16cc7289e51 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 22 Jun 2017 09:41:04 -0700 Subject: [PATCH] Fix narrowing in ostream --- CHANGELOG.md | 1 + include/beast/core/detail/ostream.hpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b01b99b..302573c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Version 65: * Enable narrowing warning on msvc cmake * Fix integer types in deflate_stream::bi_reverse * Fix narrowing in static_ostream +* Fix narrowing in ostream -------------------------------------------------------------------------------- diff --git a/include/beast/core/detail/ostream.hpp b/include/beast/core/detail/ostream.hpp index 1fafffe7..c0221124 100644 --- a/include/beast/core/detail/ostream.hpp +++ b/include/beast/core/detail/ostream.hpp @@ -105,7 +105,8 @@ public: { if(! Traits::eq_int_type(ch, Traits::eof())) { - Traits::assign(*this->pptr(), ch); + Traits::assign(*this->pptr(), + static_cast(ch)); flush(1); prepare(); return ch; @@ -185,7 +186,8 @@ public: { if(! Traits::eq_int_type(ch, Traits::eof())) { - Traits::assign(*this->pptr(), ch); + Traits::assign(*this->pptr(), + static_cast(ch)); flush(1); prepare(); return ch;