Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
mellis13 committed Nov 1, 2024
1 parent 2c327ae commit 722b1c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/serial/cpp/smartredis_put_get_bytes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ int main(int argc, char* argv[]) {

std::vector<char> output_bytes(n_bytes, 0);

client.unpack_bytes(key, output_bytes.data(), n_bytes);
size_t received_bytes = 0;
client.unpack_bytes(key, output_bytes.data(), n_bytes,
received_bytes);

if (received_bytes != n_bytes) {
std::cout<<"Output byte size "<<received_bytes<<" does not match."<<std::endl;
throw std::exception();
}

for(int i = 0; i < n_bytes; i++) {
if (output_bytes[i] != input_bytes[i]) {
Expand Down

0 comments on commit 722b1c8

Please sign in to comment.