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

Function cbm_strndup

src/foundation/compat.c:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22#ifdef _WIN32
23char *cbm_strndup(const char *s, size_t n) {
24 if (!s) {
25 return NULL;
26 }
27 size_t len = 0;
28 while (len < n && s[len]) {
29 len++;
30 }
31 char *d = (char *)malloc(len + SKIP_ONE);
32 if (d) {
33 memcpy(d, s, len);
34 d[len] = '\0';
35 }
36 return d;
37}
38#endif
39
40/* ── strcasestr (Windows lacks it) ────────────────────────────── */

Callers 15

toml_parent_directoryFunction · 0.85
jl_parent_directoryFunction · 0.85
text_parent_directoryFunction · 0.85
extract_prop_stringFunction · 0.85
path_dirnameFunction · 0.85
strip_extensionFunction · 0.85
extract_quotedFunction · 0.85
parse_go_modFunction · 0.85
xml_tag_contentFunction · 0.85
parse_mix_exsFunction · 0.85
swift_quoted_literalFunction · 0.85
resolve_sibling_fileFunction · 0.85

Calls

no outgoing calls

Tested by 1

make_mapFunction · 0.68