diff --git a/types.cc b/types.cc index 3b55bb038d..d037414413 100644 --- a/types.cc +++ b/types.cc @@ -64,7 +64,7 @@ struct int32_type_impl : simple_type_impl { return read_simple_opt(v); } int32_t compose_value(const bytes& b) { - if (b.size() != 4) { + if (b.size() != sizeof(int32_t)) { throw marshal_exception(); } return (int32_t)net::ntoh(*reinterpret_cast(b.begin()));