aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/FileUtil.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/FbTk/FileUtil.cc b/src/FbTk/FileUtil.cc
index c92b336..5ae2bc0 100644
--- a/src/FbTk/FileUtil.cc
+++ b/src/FbTk/FileUtil.cc
@@ -112,9 +112,11 @@ struct dirent *Directory::read() {
112 112
113std::string Directory::readFilename() { 113std::string Directory::readFilename() {
114 dirent *ent = read(); 114 dirent *ent = read();
115 if (ent == 0) 115 const char* name = 0;
116 return ""; 116 if (ent) {
117 return (ent->d_name ? ent->d_name : ""); 117 name = ent->d_name;
118 }
119 return (name ? name : "");
118} 120}
119 121
120void Directory::close() { 122void Directory::close() {