Revision 1e7f3638 libavutil/string.c

View differences:

libavutil/string.c
19 19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
 */
21 21

  
22
#include <stdarg.h>
23
#include <stdio.h>
22 24
#include <string.h>
23 25
#include <ctype.h>
24 26
#include "avstring.h"
......
62 64
        return len + strlen(src);
63 65
    return len + av_strlcpy(dst + len, src, size - len);
64 66
}
67

  
68
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
69
{
70
    int len = strlen(dst);
71
    va_list vl;
72

  
73
    va_start(vl, fmt);
74
    len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
75
    va_end(vl);
76

  
77
    return len;
78
}

Also available in: Unified diff