[FFmpeg-devel] [RFC] SDP Generation
Wed Jul 18 11:53:57 CEST 2007
Michael Niedermayer wrote:
>> I think this strlcatf() function can be useful for others too, and not
>> only for the SDP generator. Should I submit a patch adding av_strlcatf()
>> to libavutil/string.c?
Ok, here it is... I hope I got it right.
The attached patch implements the semantic I proposed (the returned
value is equal to the total length of the resulting string).
Maybe for consistency with av_strlcat() it could be more interesting to
return the length of the string that would have been generated if enough
space had been available. In such case, the implementation would have been
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
int len = strlen(dst);
res = vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
return len + res;
Let me know which variant is preferred, and if it is ok for commit.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the ffmpeg-devel