Re:Strlcpy and Strlcat – Consistent, Safe, String Copy and C...
by tom_ on Tuesday April 25, 2023 @09:03AM
(#35699876)
Here's something I've found a useful upgrade to asprintf, as it frees the passed-in buffer after expanding the format string. You can just pass the same char ** repeatedly (and also pass it as one of the string arguments corresponding to a %s!) and it'll update the pointer appropriately each time. Makes many kinds of string manipulation very simple.
If you thought asprintf was inefficient, this is worse. But it's very convenient!
[ Parent
| on HN ]
There are no comments on this comment yet.