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

Function text_bounded_strlen

src/cli/config_text_edit.c:152–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152static int text_bounded_strlen(const char *text, size_t maximum, size_t *len_out) {
153 if (!text || !len_out) {
154 return TEXT_ERROR;
155 }
156 size_t len = 0U;
157 while (len <= maximum && text[len] != '\0') {
158 len++;
159 }
160 if (len > maximum) {
161 return TEXT_ERROR;
162 }
163 *len_out = len;
164 return TEXT_OK;
165}
166
167static int text_decode_utf8(const unsigned char *text, size_t remaining, uint32_t *codepoint,
168 size_t *byte_count) {

Calls

no outgoing calls

Tested by

no test coverage detected