mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-15 19:59:34 +08:00
change is_* return to bool
This commit is contained in:
parent
d395bda489
commit
d46edd9a53
1 changed files with 7 additions and 7 deletions
|
@ -74,15 +74,15 @@ int fileExists(const char *filename) {
|
||||||
* @param filename
|
* @param filename
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int is_regular_file(const char *filename) {
|
bool is_regular_file(const char *filename) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
_stat(filename, &st);
|
_stat(filename, &st);
|
||||||
return S_ISREG(st.st_mode);
|
return S_ISREG(st.st_mode) != 0;
|
||||||
#else
|
#else
|
||||||
struct stat st;
|
struct stat st;
|
||||||
stat(filename, &st);
|
stat(filename, &st);
|
||||||
return S_ISREG(st.st_mode);
|
return S_ISREG(st.st_mode) != 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -90,15 +90,15 @@ int is_regular_file(const char *filename) {
|
||||||
* @param filename
|
* @param filename
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int is_directory(const char *filename) {
|
bool is_directory(const char *filename) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
_stat(filename, &st);
|
_stat(filename, &st);
|
||||||
return S_ISDIR(st.st_mode);
|
return S_ISDIR(st.st_mode) != 0;
|
||||||
#else
|
#else
|
||||||
struct stat st;
|
struct stat st;
|
||||||
stat(filename, &st);
|
stat(filename, &st);
|
||||||
return S_ISDIR(st.st_mode);
|
return S_ISDIR(st.st_mode) != 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1053,7 +1053,7 @@ int searchFile(char **foundpath, const char *pm3dir, const char *searchname, con
|
||||||
if (searchname == NULL || strlen(searchname) == 0)
|
if (searchname == NULL || strlen(searchname) == 0)
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
|
||||||
if (is_directory(searchname) != 0)
|
if (is_directory(searchname))
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue