[Xcb-commit] libxcb: src

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 30 17:18:41 UTC 2021


 src/xcb_conn.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 26396bf156cfa00ecd655ec6a5f2f46626d674c0
Author: Julien Cristau <jcristau at debian.org>
Date:   Tue Feb 2 12:15:10 2021 +0100

    Add newline when printing auth/connection failure string to stderr
    
    The reason strings returned by the server don't all include a newline,
    so make sure we add one to avoid confusing clients.  Xlib used to do
    this before it delegated that work to libxcb.
    
    Fixes #34
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 1d2e62f..3084c18 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -170,6 +170,8 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
 
 static int read_setup(xcb_connection_t *c)
 {
+    const char newline = '\n';
+
     /* Read the server response */
     c->setup = malloc(sizeof(xcb_setup_generic_t));
     if(!c->setup)
@@ -195,6 +197,7 @@ static int read_setup(xcb_connection_t *c)
         {
             xcb_setup_failed_t *setup = (xcb_setup_failed_t *) c->setup;
             write(STDERR_FILENO, xcb_setup_failed_reason(setup), xcb_setup_failed_reason_length(setup));
+            write(STDERR_FILENO, &newline, 1);
             return 0;
         }
 
@@ -202,6 +205,7 @@ static int read_setup(xcb_connection_t *c)
         {
             xcb_setup_authenticate_t *setup = (xcb_setup_authenticate_t *) c->setup;
             write(STDERR_FILENO, xcb_setup_authenticate_reason(setup), xcb_setup_authenticate_reason_length(setup));
+            write(STDERR_FILENO, &newline, 1);
             return 0;
         }
     }


More information about the xcb-commit mailing list