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

Function cbm_cmdline_put

src/foundation/subprocess.c:219–226  ·  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

217 * On overflow: sets *ovf, stops writing, and returns pos UNCHANGED — callers detect
218 * the overflow via the *ovf flag (not via the return value). */
219static size_t cbm_cmdline_put(char *buf, size_t cap, size_t pos, char c, bool *ovf) {
220 if (pos + 1 >= cap) {
221 *ovf = true;
222 return pos;
223 }
224 buf[pos] = c;
225 return pos + 1;
226}
227
228/* Append one argv element to the command line using the Microsoft C runtime
229 * 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