mirror of
https://github.com/strophe/libstrophe.git
synced 2026-07-20 04:36: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;
|
int oldret, ret;
|
||||||
char smbuf[1024];
|
char smbuf[1024];
|
||||||
char *buf;
|
char *buf;
|
||||||
|
va_list copy;
|
||||||
|
|
||||||
buf = smbuf;
|
buf = smbuf;
|
||||||
|
va_copy(copy, ap);
|
||||||
ret = xmpp_vsnprintf(buf, 1023, fmt, ap);
|
ret = xmpp_vsnprintf(buf, 1023, fmt, ap);
|
||||||
if (ret > 1023) {
|
if (ret > 1023) {
|
||||||
|
va_copy(ap, copy);
|
||||||
buf = (char *)xmpp_alloc(ctx, ret + 1);
|
buf = (char *)xmpp_alloc(ctx, ret + 1);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user