3 ms·
Reimplementing everything is not an option in C. But one should be able to pass string views directly to printf. The allocating version is what string_dup does
by uecker 4mo ago
Reimplementing everything is not an option in C. But one should be able to pass string views directly to printf.
The allocating version is what string_dup does. strv2cstr is certainly more dangerous. But as since the size is encoded in the return type, compilers can add bounds checking (and partially already do so).