diff --git a/src/FbTk/FileUtil.cc b/src/FbTk/FileUtil.cc index c92b3361..5ae2bc0a 100644 --- a/src/FbTk/FileUtil.cc +++ b/src/FbTk/FileUtil.cc @@ -112,9 +112,11 @@ struct dirent *Directory::read() { std::string Directory::readFilename() { dirent *ent = read(); - if (ent == 0) - return ""; - return (ent->d_name ? ent->d_name : ""); + const char* name = 0; + if (ent) { + name = ent->d_name; + } + return (name ? name : ""); } void Directory::close() {