diff --git a/src/rolegen.cpp.in b/src/rolegen.cpp.in
index 3c2740f..eb68959 100755
--- a/src/rolegen.cpp.in
+++ b/src/rolegen.cpp.in
@@ -51,7 +51,7 @@ static bool isPrivilegedAppId(const char *appId)
 static bool fexists(string filename)
 {
   ifstream ifile(filename.c_str());
-  return ifile;
+  return ifile.good();
 }
 
 static void checkDirStructure()
