#endif
#include <string.h>
-#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <pulsecore/x11prop.h>
#include <pulsecore/log.h>
#include <pulsecore/core-util.h>
+#include <pulsecore/macro.h>
#include "client-conf-x11.h"
int ret = -1;
char t[1024];
- if (!dname && !getenv("DISPLAY"))
+ pa_assert(c);
+
+ if (!dname && !(dname = getenv("DISPLAY")))
+ goto finish;
+
+ if (*dname == 0)
goto finish;
if (!(d = XOpenDisplay(dname))) {
goto finish;
}
- assert(sizeof(cookie) == sizeof(c->cookie));
+ pa_assert(sizeof(cookie) == sizeof(c->cookie));
memcpy(c->cookie, cookie, sizeof(cookie));
- c->cookie_valid = 1;
+ c->cookie_valid = TRUE;
pa_xfree(c->cookie_file);
c->cookie_file = NULL;