Merge pull request #10 from hoelzro/master

Fix logging when stanzas are too big
This commit is contained in:
Jack Moffitt
2012-02-07 20:30:10 -08:00

View File

@@ -250,10 +250,13 @@ void xmpp_log(const xmpp_ctx_t * const ctx,
int oldret, ret;
char smbuf[1024];
char *buf;
va_list copy;
buf = smbuf;
va_copy(copy, ap);
ret = xmpp_vsnprintf(buf, 1023, fmt, ap);
if (ret > 1023) {
va_copy(ap, copy);
buf = (char *)xmpp_alloc(ctx, ret + 1);
if (!buf) {
buf = NULL;