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