From: Pierre Habouzit Date: Sun, 27 May 2007 20:10:48 +0000 (+0200) Subject: Small fixes. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=03c8a86d85fc313b6772a1cdfc07e635583f9ed0;p=apps%2Fmadmutt.git Small fixes. --- diff --git a/lib-lib/buffer.c b/lib-lib/buffer.c index 71f31b4..25f930d 100644 --- a/lib-lib/buffer.c +++ b/lib-lib/buffer.c @@ -116,9 +116,8 @@ ssize_t buffer_addvf(buffer_t *buf, const char *fmt, va_list args) buffer_ensure(buf, BUFSIZ); len = vsnprintf(buf->data + buf->len, buf->size - buf->len, fmt, args); - if (len < 0) { - len = 0; - } + if (len < 0) + return len; if (len >= buf->size - buf->len) { buffer_ensure(buf, len); vsnprintf(buf->data + buf->len, buf->size - buf->len, fmt, ap); @@ -129,7 +128,8 @@ ssize_t buffer_addvf(buffer_t *buf, const char *fmt, va_list args) return len; } -ssize_t buffer_addf(buffer_t *buf, const char *fmt, ...) { +ssize_t buffer_addf(buffer_t *buf, const char *fmt, ...) +{ ssize_t res; va_list args; va_start(args, fmt);