MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / runtime_wire_string_encode

Function runtime_wire_string_encode

src/daemon/runtime.c:323–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value,
324 bool allow_empty) {
325 size_t length = 0;
326 if (!out || !runtime_bounded_length(value, capacity, &length) ||
327 (!allow_empty && length == 0)) {
328 return false;
329 }
330 memset(out, 0, capacity);
331 memcpy(out, value, length);
332 return true;
333}
334
335static bool runtime_wire_string_decode(const uint8_t *in, size_t capacity, char *out,
336 bool allow_empty) {

Calls 1

runtime_bounded_lengthFunction · 0.85

Tested by

no test coverage detected