]> andersk Git - openssh.git/blobdiff - session.c
- deraadt@cvs.openbsd.org 2002/06/23 21:06:41
[openssh.git] / session.c
index fab66d6b71ba4755a01aa511d98e04fa93ebcb07..9abe028b06e125d226b5f7ef025122151e1fe827 100644 (file)
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.139 2002/06/23 20:39:45 deraadt Exp $");
+RCSID("$OpenBSD: session.c,v 1.140 2002/06/23 21:06:41 deraadt Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -1970,9 +1970,9 @@ session_setup_x11fwd(Session *s)
                debug("X11 display already set.");
                return 0;
        }
-       s->display_number = x11_create_display_inet(options.x11_display_offset,
-           options.x11_use_localhost, s->single_connection);
-       if (s->display_number == -1) {
+       if (x11_create_display_inet(options.x11_display_offset,
+           options.x11_use_localhost, s->single_connection,
+           &s->display_number) == -1) {
                debug("x11_create_display_inet failed.");
                return 0;
        }
@@ -1986,9 +1986,9 @@ session_setup_x11fwd(Session *s)
         * different than the DISPLAY string for localhost displays.
         */
        if (options.x11_use_localhost) {
-               snprintf(display, sizeof display, "localhost:%d.%d",
+               snprintf(display, sizeof display, "localhost:%u.%u",
                    s->display_number, s->screen);
-               snprintf(auth_display, sizeof auth_display, "unix:%d.%d",
+               snprintf(auth_display, sizeof auth_display, "unix:%u.%u",
                    s->display_number, s->screen);
                s->display = xstrdup(display);
                s->auth_display = xstrdup(auth_display);
@@ -2004,10 +2004,10 @@ session_setup_x11fwd(Session *s)
                        return 0;
                }
                memcpy(&my_addr, he->h_addr_list[0], sizeof(struct in_addr));
-               snprintf(display, sizeof display, "%.50s:%d.%d", inet_ntoa(my_addr),
+               snprintf(display, sizeof display, "%.50s:%u.%u", inet_ntoa(my_addr),
                    s->display_number, s->screen);
 #else
-               snprintf(display, sizeof display, "%.400s:%d.%d", hostname,
+               snprintf(display, sizeof display, "%.400s:%u.%u", hostname,
                    s->display_number, s->screen);
 #endif
                s->display = xstrdup(display);
This page took 0.033393 seconds and 4 git commands to generate.