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

Function bootstrap_worker_budget_valid

src/daemon/bootstrap.c:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92static bool bootstrap_worker_budget_valid(const char *text) {
93 if (!text || !text[0]) {
94 return false;
95 }
96 size_t value = 0;
97 for (const unsigned char *cursor = (const unsigned char *)text; *cursor; cursor++) {
98 if (*cursor < '0' || *cursor > '9') {
99 return false;
100 }
101 size_t digit = (size_t)(*cursor - '0');
102 if (value > (SIZE_MAX - digit) / 10U) {
103 return false;
104 }
105 value = value * 10U + digit;
106 }
107 return value > 0;
108}
109
110/* Keep the bootstrap role boundary exact and fail closed before any client or
111 * worker state is initialized. index_supervisor owns the matching builder and

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected