summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2020-01-08 13:18:17 -0600
committerHarsh Sharma <harsh.sharma@multitech.com>2020-01-08 13:18:17 -0600
commitd32e7c87879f19951b707617cb7291339be86309 (patch)
tree98c73661ed42bd6a7761a1b88e7954ea7b06eab7
parentafd71988ef74e331a0ac24c53f85175aee082a43 (diff)
downloadmts-io-sysfs-d32e7c87879f19951b707617cb7291339be86309.tar.gz
mts-io-sysfs-d32e7c87879f19951b707617cb7291339be86309.tar.bz2
mts-io-sysfs-d32e7c87879f19951b707617cb7291339be86309.zip
Bug fix: fileExists struct was not initialized
-rw-r--r--include/Utility/Utility.h4
1 files 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 {