diff --git a/plugins/image-source/image-source.c b/plugins/image-source/image-source.c index f8729663a..b962fa8a0 100644 --- a/plugins/image-source/image-source.c +++ b/plugins/image-source/image-source.c @@ -30,7 +30,8 @@ struct image_source { static time_t get_modified_timestamp(const char *filename) { struct stat stats; - stat(filename, &stats); + if (stat(filename, &stats) != 0) + return -1; return stats.st_mtime; } diff --git a/plugins/text-freetype2/text-functionality.c b/plugins/text-freetype2/text-functionality.c index 066675b7d..684a2a573 100644 --- a/plugins/text-freetype2/text-functionality.c +++ b/plugins/text-freetype2/text-functionality.c @@ -322,7 +322,8 @@ time_t get_modified_timestamp(char *filename) // stat is apparently terrifying and horrible, but we only call it once // every second at most. - stat(filename, &stats); + if (stat(filename, &stats) != 0) + return -1; return stats.st_mtime; }