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

Function cbm_cmdline_put

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

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