From: Guus Sliepen Date: Tue, 6 May 2014 11:01:48 +0000 (+0200) Subject: Fix compiler warnings. X-Git-Tag: release-1.1pre11~120 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=27acb5d04792f2da70e937543de9110e16aae21c;p=tinc Fix compiler warnings. --- diff --git a/src/ed25519/ecdsa.c b/src/ed25519/ecdsa.c index 1da27977..4515131a 100644 --- a/src/ed25519/ecdsa.c +++ b/src/ed25519/ecdsa.c @@ -38,7 +38,7 @@ ecdsa_t *ecdsa_set_base64_public_key(const char *p) { int len = strlen(p); if(len != 43) { - logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %s for public key!", len); + logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %d for public key!", len); return 0; } diff --git a/src/ed25519/sha512.c b/src/ed25519/sha512.c index 635d8ae0..cb8ae717 100644 --- a/src/ed25519/sha512.c +++ b/src/ed25519/sha512.c @@ -268,8 +268,8 @@ int sha512(const unsigned char *message, size_t message_len, unsigned char *out) { sha512_context ctx; int ret; - if (ret = sha512_init(&ctx)) return ret; - if (ret = sha512_update(&ctx, message, message_len)) return ret; - if (ret = sha512_final(&ctx, out)) return ret; + if ((ret = sha512_init(&ctx))) return ret; + if ((ret = sha512_update(&ctx, message, message_len))) return ret; + if ((ret = sha512_final(&ctx, out))) return ret; return 0; -} \ No newline at end of file +} diff --git a/src/sptps_keypair.c b/src/sptps_keypair.c index 63f396a8..f66a7711 100644 --- a/src/sptps_keypair.c +++ b/src/sptps_keypair.c @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) { ecdsa_write_pem_private_key(key, fp); fclose(fp); } else { - fprintf(stderr, "Could not open '%s' for writing: %s\n", strerror(errno)); + fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[1], strerror(errno)); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { ecdsa_write_pem_public_key(key, fp); fclose(fp); } else { - fprintf(stderr, "Could not open '%s' for writing: %s\n", strerror(errno)); + fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[2], strerror(errno)); return 1; }