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

Function cbm_cmdline_put

src/foundation/subprocess.c:143–150  ·  view source on GitHub ↗

Append char `c` to buf[cap], reserving the final byte for a NUL terminator. * On overflow: sets *ovf, stops writing, and returns pos UNCHANGED — callers detect * the overflow via the *ovf flag (not via the return value). */

Source from the content-addressed store, hash-verified

141 * On overflow: sets *ovf, stops writing, and returns pos UNCHANGED — callers detect
142 * the overflow via the *ovf flag (not via the return value). */
143static size_t cbm_cmdline_put(char *buf, size_t cap, size_t pos, char c, bool *ovf) {
144 if (pos + 1 >= cap) {
145 *ovf = true;
146 return pos;
147 }
148 buf[pos] = c;
149 return pos + 1;
150}
151
152/* Append one argv element to the command line using the Microsoft C runtime
153 * quoting rules (see MS "Parsing C Command-Line Arguments"). CreateProcess takes

Callers 1

cbm_cmdline_append_argFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected