diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-08-08 10:40:32 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-08-08 10:40:32 +0200 |
commit | a44c204a6250832470408a89c9dd0c1cbc2e3fab (patch) | |
tree | b116092a6ddef61d8bfe0327be356708a7e360b5 /src | |
parent | 38ee006289835a975a8855c90eb89f2baf103fe0 (diff) |
Set stat to 0 before populating it
Diffstat (limited to 'src')
-rw-r--r-- | src/fileutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileutils.c b/src/fileutils.c index 197a201..131472b 100644 --- a/src/fileutils.c +++ b/src/fileutils.c @@ -53,7 +53,7 @@ int file_get_content(const char *filepath, char **data, long *size) { } int file_get_last_modified_time(const char *path, time_t *last_modified) { - struct stat s; + struct stat s = {0}; if(stat(path, &s) == 0) { *last_modified = s.st_mtim.tv_sec; return 0; @@ -94,7 +94,7 @@ int create_directory_recursive(char *path) { } static int is_directory(const char *path) { - struct stat s; + struct stat s = {0}; if(stat(path, &s) == 0) return S_ISDIR(s.st_mode); return 0; |