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). */
| 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). */ |
| 143 | static 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 |
no outgoing calls
no test coverage detected