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

Function runtime_wire_string_encode

src/daemon/runtime.c:319–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls 1

runtime_bounded_lengthFunction · 0.85

Tested by

no test coverage detected