aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-02-25 15:47:42 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-03-03 21:30:57 +0100
commite61e9795c3d19b163ebea9a230c2acc718a70d79 (patch)
treeb1633430096e7e8216674b91d97695cc53b963b3 /nx-X11/programs/Xserver/hw/nxagent/Atoms.c
parent89ccf26d65a3f205e54d9f6240b672f970e7b9c1 (diff)
downloadnx-libs-e61e9795c3d19b163ebea9a230c2acc718a70d79.tar.gz
nx-libs-e61e9795c3d19b163ebea9a230c2acc718a70d79.tar.bz2
nx-libs-e61e9795c3d19b163ebea9a230c2acc718a70d79.zip
nxagent: half number of NameForAtom calls
Because of validateString being a macro NameForAtom was called twice most of the time. Fix that by making validateString a function. Fixes ArticaProject/nx-libs#357
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Atoms.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Atoms.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index 0784d6c2c..a0b90febd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -95,6 +95,10 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
static XErrorHandler previousErrorHandler = NULL;
+const char * validateString(const char *str) {
+ return str ? str : "(null)";
+}
+
static void catchAndRedirect(Display* dpy, XErrorEvent* X)
{
if (X -> error_code == BadAccess &&