diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cc/compat_compiler.h | 6 | ||||
-rw-r--r-- | src/lib/crypt_ops/crypto_digest_nss.c | 3 | ||||
-rw-r--r-- | src/lib/net/address.c | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h index a8d1593214..5f5f244d02 100644 --- a/src/lib/cc/compat_compiler.h +++ b/src/lib/cc/compat_compiler.h @@ -50,6 +50,12 @@ #define CHECK_SCANF(formatIdx, firstArg) #endif /* defined(__GNUC__) */ +#if defined(HAVE_ATTR_FALLTHROUGH) +#define FALLTHROUGH __attribute__((fallthrough)) +#else +#define FALLTHROUGH +#endif + /* What GCC do we have? */ #ifdef __GNUC__ #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) diff --git a/src/lib/crypt_ops/crypto_digest_nss.c b/src/lib/crypt_ops/crypto_digest_nss.c index b73f0736fd..bc7a0fab16 100644 --- a/src/lib/crypt_ops/crypto_digest_nss.c +++ b/src/lib/crypt_ops/crypto_digest_nss.c @@ -87,7 +87,7 @@ library_supports_digest(digest_algorithm_t alg) switch (alg) { case DIGEST_SHA1: /* Fall through */ case DIGEST_SHA256: /* Fall through */ - case DIGEST_SHA512: /* Fall through */ + case DIGEST_SHA512: return true; case DIGEST_SHA3_256: /* Fall through */ case DIGEST_SHA3_512: /* Fall through */ @@ -557,4 +557,3 @@ crypto_hmac_sha256(char *hmac_out, tor_assert(ok); } - diff --git a/src/lib/net/address.c b/src/lib/net/address.c index 546af800a9..2cd193cf1b 100644 --- a/src/lib/net/address.c +++ b/src/lib/net/address.c @@ -928,6 +928,7 @@ tor_addr_copy_tight(tor_addr_t *dest, const tor_addr_t *src) break; case AF_INET6: memcpy(dest->addr.in6_addr.s6_addr, src->addr.in6_addr.s6_addr, 16); + break; case AF_UNSPEC: break; // LCOV_EXCL_START |