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:
committed by
Sébastien Helleu
parent
24c4029c96
commit
23e0533ea1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user