make sure we pass null (rather than blank) to XOpenDisplay

This commit is contained in:
rathnor 2003-07-19 14:07:28 +00:00
parent 9c3b06945a
commit 1591c15b8b

View file

@ -40,6 +40,10 @@ App::App(const char *displayname):m_done(false) {
if (s_app != 0) if (s_app != 0)
throw std::string("Can't create more than one instance of FbTk::App"); throw std::string("Can't create more than one instance of FbTk::App");
s_app = this; s_app = this;
// this allows the use of std::string.c_str(), which returns
// a blank string, rather than a null string, so we make them equivalent
if (displayname != 0 && displayname[0] == '\0')
displayname = 0;
m_display = XOpenDisplay(displayname); m_display = XOpenDisplay(displayname);
} }