1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: remove unnecessary call to stat() in hash file function

The call to fopen() will fail anyway if the file doesn't exist.
This commit is contained in:
Mario Campos
2024-03-13 07:15:12 +01:00
committed by Sébastien Helleu
parent 24c4029c96
commit 23e0533ea1
-4
View File
@@ -285,7 +285,6 @@ weecrypto_hash_file (const char *filename, int hash_algo,
void *hash, int *hash_size)
{
gcry_md_hd_t *hd_md;
struct stat st;
FILE *file;
size_t num_read;
int rc, hd_md_opened, algo_size;
@@ -306,9 +305,6 @@ weecrypto_hash_file (const char *filename, int hash_algo,
if (!filename || !filename[0] || !hash)
goto hash_end;
if (stat (filename, &st) == -1)
goto hash_end;
file = fopen (filename, "r");
if (!file)
goto hash_end;