Fix various compiler warnings.

fish.c: -Wincompatible-pointer-types
fkeys.c: -Wmisleading-indentation
proto-irc.c: -Wincompatible-pointer-types
util.c: -Wdeprecated-declarations
xtext.c: -Wmaybe-uninitialized
This commit is contained in:
Sadie Powell
2022-08-28 17:59:42 +01:00
committed by Patrick
parent 20c50fd7ef
commit 46c9df1863
5 changed files with 9 additions and 4 deletions

View File

@@ -1375,11 +1375,16 @@ str_sha256hash (char *string)
int i;
unsigned char hash[SHA256_DIGEST_LENGTH];
char buf[SHA256_DIGEST_LENGTH * 2 + 1]; /* 64 digit hash + '\0' */
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
SHA256 (string, strlen (string), hash);
#else
SHA256_CTX sha256;
SHA256_Init (&sha256);
SHA256_Update (&sha256, string, strlen (string));
SHA256_Final (hash, &sha256);
#endif
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
{