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

Function cbm_strndup

src/foundation/compat.c:22–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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