diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FileUtil.cc | 8 |
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 | ||
113 | std::string Directory::readFilename() { | 113 | std::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 | ||
120 | void Directory::close() { | 122 | void Directory::close() { |