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

Function platform_copy_environment_value

src/foundation/platform.c:358–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356#endif
357
358static const char *platform_copy_environment_value(char *buf, size_t buf_sz, const char *value) {
359 if (!buf || buf_sz == 0 || !value) {
360 return NULL;
361 }
362 size_t length = strlen(value);
363 if (length >= buf_sz) {
364 buf[0] = '\0';
365 return NULL;
366 }
367 memcpy(buf, value, length + 1U);
368 return buf;
369}
370
371const char *cbm_safe_getenv(const char *name, char *buf, size_t buf_sz, const char *fallback) {
372 if (!name || !name[0] || !buf || buf_sz == 0) {

Callers 1

cbm_safe_getenvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected