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

Function bootstrap_worker_budget_valid

src/daemon/bootstrap.c:80–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static bool bootstrap_worker_budget_valid(const char *text) {
81 if (!text || !text[0]) {
82 return false;
83 }
84 size_t value = 0;
85 for (const unsigned char *cursor = (const unsigned char *)text; *cursor; cursor++) {
86 if (*cursor < '0' || *cursor > '9') {
87 return false;
88 }
89 size_t digit = (size_t)(*cursor - '0');
90 if (value > (SIZE_MAX - digit) / 10U) {
91 return false;
92 }
93 value = value * 10U + digit;
94 }
95 return value > 0;
96}
97
98/* Keep the bootstrap role boundary exact and fail closed before any client or
99 * worker state is initialized. index_supervisor owns the matching builder and

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected