diff --git a/libraries/eosiolib/eosiolib.cpp b/libraries/eosiolib/eosiolib.cpp index 64c1791b8f..6ad03ac54d 100644 --- a/libraries/eosiolib/eosiolib.cpp +++ b/libraries/eosiolib/eosiolib.cpp @@ -49,10 +49,10 @@ namespace eosio { } std::vector get_active_producers() { - auto prod_cnt = get_active_producers(nullptr, 0)/8; - std::vector active_prods(prod_cnt); - get_active_producers((uint64_t*)active_prods.data(), active_prods.size()); - return active_prods; + auto buffer_size = get_active_producers(nullptr, 0); + std::vector active_prods(buffer_size / sizeof(uint64_t)); + get_active_producers((uint64_t*)active_prods.data(), buffer_size); + return active_prods; } } // namespace eosio