Verified Commit b0ddc0f4 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

bugfix: wrong size parsing in DecrementSizeOperand

The decrement size operand does not have a trailing slash, thus we need
to add it before to use std::stoul.
parent b3e2f834
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -64,7 +64,9 @@ DecreaseSizeOperand::DecreaseSizeOperand(const size_t size) :
DecreaseSizeOperand::DecreaseSizeOperand(const rdb::Slice& serialized_op){
    //Parse size
    size_t read = 0;
    size = std::stoul(serialized_op.data(), &read);
    //we need to convert serialized_op to a string because it doesn't contain the
    //leading slash needed by stoul
    size = std::stoul(serialized_op.ToString(), &read);
    //check that we consumed all the input string
    assert(read == serialized_op.size());
}