From d46edd9a53d917a97b742def167a7870633adf8a Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 21 Sep 2019 20:22:17 +0200 Subject: [PATCH] change is_* return to bool --- client/fileutils.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/fileutils.c b/client/fileutils.c index 35fa735ea..6efe4c17b 100644 --- a/client/fileutils.c +++ b/client/fileutils.c @@ -74,15 +74,15 @@ int fileExists(const char *filename) { * @param filename * @return */ -int is_regular_file(const char *filename) { +bool is_regular_file(const char *filename) { #ifdef _WIN32 struct _stat st; _stat(filename, &st); - return S_ISREG(st.st_mode); + return S_ISREG(st.st_mode) != 0; #else struct stat st; stat(filename, &st); - return S_ISREG(st.st_mode); + return S_ISREG(st.st_mode) != 0; #endif } /** @@ -90,15 +90,15 @@ int is_regular_file(const char *filename) { * @param filename * @return */ -int is_directory(const char *filename) { +bool is_directory(const char *filename) { #ifdef _WIN32 struct _stat st; _stat(filename, &st); - return S_ISDIR(st.st_mode); + return S_ISDIR(st.st_mode) != 0; #else struct stat st; stat(filename, &st); - return S_ISDIR(st.st_mode); + return S_ISDIR(st.st_mode) != 0; #endif } @@ -1053,7 +1053,7 @@ int searchFile(char **foundpath, const char *pm3dir, const char *searchname, con if (searchname == NULL || strlen(searchname) == 0) return PM3_EINVARG; - if (is_directory(searchname) != 0) + if (is_directory(searchname)) return PM3_EINVARG;