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

Function text_bounded_strlen

src/cli/config_text_edit.c:151–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls

Tested by

no test coverage detected