Richard Nyberg 18 年前
父节点
当前提交
68c4f99b29
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      libevent/buffer.c

+ 5
- 2
libevent/buffer.c 查看文件

@@ -132,17 +132,20 @@ evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
size_t space; size_t space;
size_t oldoff = buf->off; size_t oldoff = buf->off;
int sz; int sz;
va_list aq;


for (;;) { for (;;) {
buffer = buf->buffer + buf->off; buffer = buf->buffer + buf->off;
space = buf->totallen - buf->misalign - buf->off; space = buf->totallen - buf->misalign - buf->off;


va_copy(aq, ap);
#ifdef WIN32 #ifdef WIN32
sz = vsnprintf(buffer, space - 1, fmt, ap);
sz = vsnprintf(buffer, space - 1, fmt, aq);
buffer[space - 1] = '\0'; buffer[space - 1] = '\0';
#else #else
sz = vsnprintf(buffer, space, fmt, ap);
sz = vsnprintf(buffer, space, fmt, aq);
#endif #endif
va_end(aq);
if (sz == -1) if (sz == -1)
return (-1); return (-1);
if (sz < space) { if (sz < space) {


正在加载...
取消
保存