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

Function cli_checksum_manifest_path

tests/test_cli.c:12143–12163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12141}
12142
12143static bool cli_checksum_manifest_path(char *path, size_t path_size) {
12144 int written = snprintf(path, path_size, "%s/cbm-checksum-XXXXXX", cbm_tmpdir());
12145 if (written <= 0 || (size_t)written >= path_size) {
12146 return false;
12147 }
12148 int descriptor = cbm_mkstemp(path);
12149 if (descriptor < 0) {
12150 return false;
12151 }
12152 FILE *file = fdopen(descriptor, "wb");
12153 if (!file) {
12154#ifdef _WIN32
12155 (void)_close(descriptor);
12156#else
12157 (void)close(descriptor);
12158#endif
12159 (void)cbm_unlink(path);
12160 return false;
12161 }
12162 return fclose(file) == 0;
12163}
12164
12165TEST(cli_checksum_manifest_requires_exact_filename_and_accepts_star) {
12166 static const char lower_digest[] =

Callers 1

test_cli.cFile · 0.85

Calls 3

cbm_tmpdirFunction · 0.85
cbm_mkstempFunction · 0.85
cbm_unlinkFunction · 0.85

Tested by

no test coverage detected