On 2023-03-25 04:49, Bruno Haible wrote:

I'll add a comment regarding printf with the "%.*s" directive.

That works only if the string lacks NULs and its length fits into int, and one must also convert the idx_t length to int (e.g., via a cast which I find tricky). Although these limitations could be documented, it might also be good to have an API like quotearg to generate a quoted or quotable string that can be printed with plain %s.

Reply via email to