From d32e7c87879f19951b707617cb7291339be86309 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Wed, 8 Jan 2020 13:18:17 -0600 Subject: Bug fix: fileExists struct was not initialized --- include/Utility/Utility.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Utility/Utility.h b/include/Utility/Utility.h index 0c1f16c..bd6019e 100644 --- a/include/Utility/Utility.h +++ b/include/Utility/Utility.h @@ -22,7 +22,7 @@ ***********************************************************************/ inline bool fileExists(std::string file) { - struct stat buffer; + struct stat buffer = {}; return (stat (file.c_str(), &buffer) == 0) ? true : false; } @@ -48,7 +48,7 @@ inline void exitHandler(int code) { } inline mode_t fileType(std::string file) { - struct stat buf = { .st_dev = 0 }; + struct stat buf = {}; if (stat (file.c_str(), &buf) == 0) { return buf.st_mode & S_IFMT; } else { -- cgit v1.2.3