提交 a6ada792 编写于 作者: K Kevin Heifner

Fix copy/paste error and compiler warnings

上级 eb1ac0ce
......@@ -31,7 +31,7 @@ namespace eosio {
size_t size = action_data_size();
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
read_action_data( buffer, size );
set_proposed_producers(buffer, sizeof(buffer));
set_proposed_producers(buffer, size);
}
void reqauth( action_name from ) {
......
......@@ -48,7 +48,7 @@ namespace eosio {
size_t size = action_data_size();
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
read_action_data( buffer, size );
return unpack<T>( buffer, sizeof(buffer) );
return unpack<T>( buffer, size );
}
using ::require_auth;
......
......@@ -77,12 +77,13 @@ namespace eosio {
*/
inline action get_action( uint32_t type, uint32_t index ) {
constexpr size_t max_stack_buffer_size = 128;
auto size = ::get_action(type, index, nullptr, 0);
eosio_assert( size > 0, "get_action size failed" );
int s = ::get_action( type, index, nullptr, 0 );
eosio_assert( s > 0, "get_action size failed" );
size_t size = static_cast<size_t>(s);
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
auto size2 = ::get_action(type, index, buffer, static_cast<size_t>(size) );
eosio_assert( size == size2, "get_action failed" );
return eosio::unpack<eosio::action>(buffer, static_cast<size_t>(size));
auto size2 = ::get_action( type, index, buffer, size );
eosio_assert( size == static_cast<size_t>(size2), "get_action failed" );
return eosio::unpack<eosio::action>( buffer, size );
}
///@} transactioncpp api
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册