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

Function yaml_validate_key

src/cli/config_yaml_edit.c:286–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286static int yaml_validate_key(const char *key, size_t *out_len) {
287 size_t len = 0;
288 if (yaml_bounded_strlen(key, YAML_KEY_MAX, &len) != 0 || len == 0U) {
289 return YAML_ERROR;
290 }
291 for (size_t i = 0; i < len; i++) {
292 unsigned char c = (unsigned char)key[i];
293 if (!(isalnum(c) || c == '_' || c == '-' || c == '.')) {
294 return YAML_ERROR;
295 }
296 }
297 *out_len = len;
298 return 0;
299}
300
301static int yaml_validate_text_bytes_from(const char *data, size_t len, size_t from);
302

Calls 1

yaml_bounded_strlenFunction · 0.85

Tested by

no test coverage detected