aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl_connect_without_handshake.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-15 15:25:17 +0200
committerMattias Andrée <maandree@kth.se>2020-06-15 15:25:17 +0200
commit629b5ab9f3f03f54fb115d169ed2bbe666f2799f (patch)
treef863eb25c0672123d48523b9b3a76e046a3873e3 /libaxl_connect_without_handshake.c
parentMisc, mainly connect stuff (diff)
downloadlibaxl-629b5ab9f3f03f54fb115d169ed2bbe666f2799f.tar.gz
libaxl-629b5ab9f3f03f54fb115d169ed2bbe666f2799f.tar.bz2
libaxl-629b5ab9f3f03f54fb115d169ed2bbe666f2799f.tar.xz
libaxl_receive_handshake and libaxl_send_request
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libaxl_connect_without_handshake.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libaxl_connect_without_handshake.c b/libaxl_connect_without_handshake.c
index 181cdb2..e05dd66 100644
--- a/libaxl_connect_without_handshake.c
+++ b/libaxl_connect_without_handshake.c
@@ -62,6 +62,7 @@ libaxl_connect_without_handshake(const char *host, const char *protocol, int dis
if ((!protocol || !*protocol) && (!host || !*host)) {
sprintf(path, "/tmp/.X11-unix/X%i", display);
fd = connect_unix(path);
+ /* TODO also try abstract address version with a NUL byte before it (truncate address to remove tailing NULs) */
if (fd < 0) {
fd = connect_tcp_ip("localhost", display);
if (fd >= 0)
@@ -88,7 +89,7 @@ libaxl_connect_without_handshake(const char *host, const char *protocol, int dis
conn = libaxl_create(fd);
if (conn)
- conn->info.default_screen_number = screen;
+ conn->info.default_screen_number = screen < 0 ? 0 : screen;
return conn;
}