>From 22df5d61a0ef215bb5d883e59cb2f899229d06d0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 9 Jun 2011 10:38:38 +0200 Subject: [PATCH] Fix up compiler warnings. --- lib/pkcs11.c | 6 ++---- src/cli.c | 3 +-- src/p11common.c | 3 +-- src/pkcs11.c | 4 ---- tests/suite/mini-eagain2.c | 2 ++ 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 01527f2..7b3e106 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -308,8 +308,8 @@ pkcs11_get_info (struct p11_kit_uri *info, size_t str_max = 0; int terminate = 0; int hexify = 0; - size_t length; - const char *data; + size_t length = 0; + const char *data = NULL; char buf[32]; /* @@ -381,8 +381,6 @@ pkcs11_get_info (struct p11_kit_uri *info, (int)version->minor); terminate = 1; } - else - return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); /* data and len are uninitialized */ if (hexify) { diff --git a/src/cli.c b/src/cli.c index 1e43dc2..7cf87cb 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1152,11 +1152,10 @@ psk_callback (gnutls_session_t session, char **username, gnutls_datum_t * key) { char *tmp = NULL; size_t n; - ssize_t len; printf ("Enter PSK identity: "); fflush (stdout); - len = getline (&tmp, &n, stdin); + getline (&tmp, &n, stdin); if (tmp == NULL) { diff --git a/src/p11common.c b/src/p11common.c index f91123f..799f866 100644 --- a/src/p11common.c +++ b/src/p11common.c @@ -93,7 +93,6 @@ static int token_callback (void *user, const char *label, const unsigned retry) { char buf[32]; - char *p; if (retry > 0) { @@ -101,7 +100,7 @@ token_callback (void *user, const char *label, const unsigned retry) return -1; } printf ("Please insert token '%s' in slot and press enter\n", label); - p = fgets (buf, sizeof (buf), stdin); + fgets (buf, sizeof (buf), stdin); return 0; } diff --git a/src/pkcs11.c b/src/pkcs11.c index fef2839..4bb10a6 100644 --- a/src/pkcs11.c +++ b/src/pkcs11.c @@ -859,13 +859,9 @@ pkcs11_mechanism_list (FILE * outfile, const char *url, unsigned int login, { int ret; int idx; - unsigned int obj_flags = 0; unsigned long mechanism; const char *str; - if (login) - obj_flags = GNUTLS_PKCS11_OBJ_FLAG_LOGIN; - pkcs11_common (); if (url == NULL) diff --git a/tests/suite/mini-eagain2.c b/tests/suite/mini-eagain2.c index 284fdc9..59a096b 100644 --- a/tests/suite/mini-eagain2.c +++ b/tests/suite/mini-eagain2.c @@ -21,11 +21,13 @@ static int done = 0; +#if 0 static void tls_log_func (int level, const char *str) { fprintf(stderr, "|<%d>| %s", level, str); } +#endif static const char* SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status) -- 1.7.5.2