* Introduce a new strcatf() function to help simplify some areas of the code.

This commit is contained in:
Justin Maggard
2011-05-13 22:10:15 +00:00
parent 4daad1291e
commit 23746a68bf
6 changed files with 245 additions and 361 deletions

14
utils.c
View File

@ -31,6 +31,20 @@
#include "upnpglobalvars.h"
#include "log.h"
inline int
strcatf(struct string_s *str, const char *fmt, ...)
{
int ret;
va_list ap;
va_start(ap, fmt);
ret = vsnprintf(str->data + str->off, str->size - str->off, fmt, ap);
str->off += ret;
va_end(ap);
return ret;
}
int
ends_with(const char * haystack, const char * needle)
{