From f61b0aeafd2f5f2619ff21efb000026364c79230 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 5 Dec 2021 20:59:51 +0100 Subject: Version 1.6 --- src/recode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/recode.cpp b/src/recode.cpp index 89bd69b..beb133f 100644 --- a/src/recode.cpp +++ b/src/recode.cpp @@ -75,7 +75,7 @@ template void reverse_endian(std::basic_string& s) { std::for_each(s.begin(), s.end(), [](T& c){ -#if BOOST_VERSION > 107400 +#if BOOST_VERSION > 107700 boost::endian::endian_reverse_inplace(c); #else reverse_endian_inplace(c); @@ -95,7 +95,7 @@ void register_convert() if (s.size() % sizeof(typename From::value_type) != 0) throw std::invalid_argument("Bad number of input bytes. Need multiple of "s + std::to_string(sizeof(typename From::value_type)) + ", got " + std::to_string(s.size())); - std::basic_string from_data(s.size(), static_cast(0)); + std::basic_string from_data(s.size() / sizeof(typename From::value_type), static_cast(0)); std::memcpy(from_data.data(), s.data(), s.size()); -- cgit v1.2.3