aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-08 10:40:32 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-08 10:40:32 +0200
commita44c204a6250832470408a89c9dd0c1cbc2e3fab (patch)
treeb116092a6ddef61d8bfe0327be356708a7e360b5
parent38ee006289835a975a8855c90eb89f2baf103fe0 (diff)
Set stat to 0 before populating it
-rwxr-xr-xautomediabin120760 -> 120760 bytes
-rw-r--r--src/fileutils.c4
2 files changed, 2 insertions, 2 deletions
diff --git a/automedia b/automedia
index 25e8856..beb803e 100755
--- a/automedia
+++ b/automedia
Binary files differ
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;