MCPcopy Create free account
hub / github.com/SmingHub/Sming / decode

Method decode

Sming/Libraries/nanopb/src/Callback.cpp:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28bool InputCallback::decode(pb_istream_t* stream, const pb_field_t*)
29{
30 size_t available = stream->bytes_left;
31 auto new_buf = realloc(data, length + available);
32 if(new_buf == nullptr) {
33 return false;
34 }
35 data = static_cast<uint8_t*>(new_buf);
36 auto old_length = length;
37 length += available;
38
39 return pb_read(stream, &data[old_length], available);
40}
41
42} // namespace Protobuf

Callers 1

static_decodeMethod · 0.95

Calls 1

reallocFunction · 0.85

Tested by

no test coverage detected