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

Function jl_validate_key

src/cli/config_json_like.c:1786–1806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1784}
1785
1786static int jl_validate_key(const char *key) {
1787 if (!key) {
1788 return -1;
1789 }
1790 size_t length = strlen(key);
1791 if (length > JL_MAX_KEY_BYTES) {
1792 return -1;
1793 }
1794 size_t pos = 0;
1795 while (pos < length) {
1796 uint32_t codepoint = 0;
1797 size_t byte_count = 0;
1798 if (jl_decode_utf8((const unsigned char *)key + pos, length - pos, &codepoint,
1799 &byte_count) != 0 ||
1800 codepoint < 0x20U || (codepoint >= 0x7FU && codepoint <= 0x9FU)) {
1801 return -1;
1802 }
1803 pos += byte_count;
1804 }
1805 return 0;
1806}
1807
1808static int jl_validate_string_value(const char *value) {
1809 if (!value) {

Callers 1

jl_validate_argumentsFunction · 0.85

Calls 1

jl_decode_utf8Function · 0.85

Tested by

no test coverage detected