Comment Re:Just the obvious (Score 1) 320
Comment Re:We are catching up to the 1960s... (Score 1) 192
Comment Re:The 13 votes (Score 1) 477
Comment Re:Stability (Score 1) 891
Comment Re:Using CUSE for sound devices is The Right Way (Score 1) 374
Comment Re:Languages, tools, and libraries (Score 1) 956
While I agree with the general spirit of your post, please allow me to introduce you to a magic function called 'asprintf'!
'man 3 asprintf' says:
"The functions asprintf() and vasprintf() are analogs of sprintf(3) and vsprintf(3), except that they allocate a string large enough to hold the
output including the terminating null byte, and return a pointer to it via the first parameter. This pointer should be passed to free(3) to
release the allocated storage when it is no longer needed."
So your very long example just became a bit shorter. Of course you need to check if the returned string != NULL (just in case there wasn't enough memory). You also gain all the nice formatting functions of printf (though "%s%s" will do nicely in your example).