nfqws,tpws: file_mod_signature zero struct if unsuccessful

This commit is contained in:
bol-van 2025-01-24 20:57:12 +03:00
parent b39508de7f
commit f5cf7917fb
2 changed files with 10 additions and 2 deletions

View File

@ -303,7 +303,11 @@ time_t file_mod_time(const char *filename)
bool file_mod_signature(const char *filename, file_mod_sig *ms)
{
struct stat st;
if (stat(filename,&st)==-1) return false;
if (stat(filename,&st)==-1)
{
FILE_MOD_RESET(ms);
return false;
}
ms->mod_time=st.st_mtime;
ms->size=st.st_size;
return true;

View File

@ -317,7 +317,11 @@ time_t file_mod_time(const char *filename)
bool file_mod_signature(const char *filename, file_mod_sig *ms)
{
struct stat st;
if (stat(filename,&st)==-1) return false;
if (stat(filename,&st)==-1)
{
FILE_MOD_RESET(ms);
return false;
}
ms->mod_time=st.st_mtime;
ms->size=st.st_size;
return true;