Commit 617e5616 authored by David Woodhouse's avatar David Woodhouse

Add printf format attribute to buf_append()

Fix the one (harmless) warning it generates in base64 encoding.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent aa6ac0de
......@@ -45,7 +45,8 @@ struct oc_text_buf *buf_alloc(void)
return calloc(1, sizeof(struct oc_text_buf));
}
void buf_append(struct oc_text_buf *buf, const char *fmt, ...)
void __attribute__ ((format (printf, 2, 3)))
buf_append(struct oc_text_buf *buf, const char *fmt, ...)
{
va_list ap;
......@@ -1546,7 +1547,7 @@ static void b64_frag(struct oc_text_buf *buf, int len, unsigned char *in)
b64[3] = b64_table[in[2] & 0x3f];
out:
b64[4] = 0;
buf_append(buf, b64);
buf_append(buf, "%s", b64);
}
/* State in vpninfo->proxy_auth_state */
......
......@@ -560,7 +560,8 @@ int prepare_stoken(struct openconnect_info *vpninfo);
/* http.c */
struct oc_text_buf *buf_alloc(void);
void buf_append(struct oc_text_buf *buf, const char *fmt, ...);
void __attribute__ ((format (printf, 2, 3)))
buf_append(struct oc_text_buf *buf, const char *fmt, ...);
int buf_error(struct oc_text_buf *buf);
int buf_free(struct oc_text_buf *buf);
char *openconnect_create_useragent(const char *base);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment