[FFmpeg-devel] [RFC] SDP Generation
Wed Jul 18 15:08:19 CEST 2007
On Wed, Jul 18, 2007 at 11:53:57AM +0200, Luca Abeni wrote:
> 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);
> va_list vl;
> int res;
> va_start(vl, fmt);
> res = vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
> return len + res;
len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
> Let me know which variant is preferred, and if it is ok for commit.
above is prefered
and ok to commit above
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The worst form of inequality is to try to make unequal things equal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the ffmpeg-devel