mirror of
https://github.com/strophe/libstrophe.git
synced 2026-07-18 11:56:22 +00:00
Fixing logging when stanzas are too big
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user