diff options
Diffstat (limited to 'x11vnc/xwrappers.c')
-rw-r--r-- | x11vnc/xwrappers.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/x11vnc/xwrappers.c b/x11vnc/xwrappers.c index 1ec1ff3..022e59a 100644 --- a/x11vnc/xwrappers.c +++ b/x11vnc/xwrappers.c @@ -1055,15 +1055,15 @@ int xauth_raw(int on) { } return 1; } else { - if (old_xauthority && strcmp(old_xauthority, "")) { - set_env("XAUTHORITY", old_xauthority); - } else { - char *xauth = getenv("XAUTHORITY"); - if (xauth) { - *(xauth-2) = '_'; /* yow */ - } - } if (old_xauthority) { + if (!strcmp(old_xauthority, "")) { + char *xauth = getenv("XAUTHORITY"); + if (xauth) { + *(xauth-2) = '_'; /* yow */ + } + } else { + set_env("XAUTHORITY", old_xauthority); + } free(old_xauthority); old_xauthority = NULL; } |