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

Function jl_validate_key

src/cli/config_json_like.c:1853–1873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1851}
1852
1853static int jl_validate_key(const char *key) {
1854 if (!key) {
1855 return -1;
1856 }
1857 size_t length = strlen(key);
1858 if (length > JL_MAX_KEY_BYTES) {
1859 return -1;
1860 }
1861 size_t pos = 0;
1862 while (pos < length) {
1863 uint32_t codepoint = 0;
1864 size_t byte_count = 0;
1865 if (jl_decode_utf8((const unsigned char *)key + pos, length - pos, &codepoint,
1866 &byte_count) != 0 ||
1867 codepoint < 0x20U || (codepoint >= 0x7FU && codepoint <= 0x9FU)) {
1868 return -1;
1869 }
1870 pos += byte_count;
1871 }
1872 return 0;
1873}
1874
1875static int jl_validate_string_value(const char *value) {
1876 if (!value) {

Callers 1

jl_validate_argumentsFunction · 0.85

Calls 1

jl_decode_utf8Function · 0.85

Tested by

no test coverage detected