diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index c402cbb..49dc93f 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -236,7 +236,13 @@ namespace fc { // bool template inline void pack( Stream& s, const bool& v ) { pack( s, uint8_t(v) ); } - template inline void unpack( Stream& s, bool& v ) { uint8_t b; unpack( s, b ); v=(b!=0); } + template inline void unpack( Stream& s, bool& v ) + { + uint8_t b; + unpack( s, b ); + FC_ASSERT( (b & ~1) == 0 ); + v=(b!=0); + } namespace detail {