Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some clang format-nonliteral warnings
Unfortunately it doesn't look like we can fix the vfprintf_utf8() warnings.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 29, 2014
1 parent 048aa03 commit a1cce28
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion jni.c
Expand Up @@ -484,7 +484,8 @@ static int process_auth_form_cb(void *privdata, struct oc_auth_form *form)
return -1;
}

static void progress_cb(void *privdata, int level, const char *fmt, ...)
static void __attribute__ ((format(printf, 3, 4)))
progress_cb(void *privdata, int level, const char *fmt, ...)
{
struct libctx *ctx = privdata;
va_list ap;
Expand Down
13 changes: 8 additions & 5 deletions main.c
Expand Up @@ -64,8 +64,8 @@ static const char *legacy_charset;

static int write_new_config(void *_vpninfo,
const char *buf, int buflen);
static void write_progress(void *_vpninfo,
int level, const char *fmt, ...);
static void __attribute__ ((format(printf, 3, 4)))
write_progress(void *_vpninfo, int level, const char *fmt, ...);
static int validate_peer_cert(void *_vpninfo,
OPENCONNECT_X509 *peer_cert,
const char *reason);
Expand Down Expand Up @@ -100,7 +100,8 @@ static int sig_cmd_fd;

#ifdef __ANDROID__
#include <android/log.h>
static void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
static void __attribute__ ((format(printf, 3, 4)))
syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
{
static int l[4] = {
ANDROID_LOG_ERROR, /* PRG_ERR */
Expand Down Expand Up @@ -129,7 +130,8 @@ static void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
*/
#else /* !__ANDROID__ && !_WIN32 */
#include <syslog.h>
static void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
static void __attribute__ ((format(printf, 3, 4)))
syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
{
int priority = level ? LOG_INFO : LOG_NOTICE;
va_list args;
Expand Down Expand Up @@ -1496,7 +1498,8 @@ static int write_new_config(void *_vpninfo, const char *buf, int buflen)
return 0;
}

void write_progress(void *_vpninfo, int level, const char *fmt, ...)
static void __attribute__ ((format(printf, 3, 4)))
write_progress(void *_vpninfo, int level, const char *fmt, ...)
{
FILE *outf = level ? stdout : stderr;
va_list args;
Expand Down
3 changes: 2 additions & 1 deletion openconnect-internal.h
Expand Up @@ -594,7 +594,8 @@ void cstp_free_splits(struct openconnect_info *vpninfo);
/* ssl.c */
unsigned string_is_hostname(const char* str);
int connect_https_socket(struct openconnect_info *vpninfo);
int request_passphrase(struct openconnect_info *vpninfo, const char *label,
int __attribute__ ((format(printf, 4, 5)))
request_passphrase(struct openconnect_info *vpninfo, const char *label,
char **response, const char *fmt, ...);
int __attribute__ ((format (printf, 2, 3)))
openconnect_SSL_printf(struct openconnect_info *vpninfo, const char *fmt, ...);
Expand Down
3 changes: 2 additions & 1 deletion ssl.c
Expand Up @@ -335,7 +335,8 @@ int __attribute__ ((format (printf, 2, 3)))

}

int request_passphrase(struct openconnect_info *vpninfo, const char *label,
int __attribute__ ((format(printf, 4, 5)))
request_passphrase(struct openconnect_info *vpninfo, const char *label,
char **response, const char *fmt, ...)
{
struct oc_auth_form f;
Expand Down

0 comments on commit a1cce28

Please sign in to comment.