Mercurial > dropbear
comparison svr-x11fwd.c @ 1247:428d83f2e5db
merge github master
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 10 Mar 2016 21:37:35 +0800 |
parents | a3e8389e01ff 888e3d17e962 |
children | 3a383aaeb487 |
comparison
equal
deleted
inserted
replaced
1235:11f645c3715b | 1247:428d83f2e5db |
---|---|
163 if (chansess->x11listener == NULL) { | 163 if (chansess->x11listener == NULL) { |
164 return; | 164 return; |
165 } | 165 } |
166 | 166 |
167 /* create the DISPLAY string */ | 167 /* create the DISPLAY string */ |
168 val = snprintf(display, sizeof(display), "localhost:%d.%d", | 168 val = snprintf(display, sizeof(display), "localhost:%d.%u", |
169 chansess->x11port - X11BASEPORT, chansess->x11screennum); | 169 chansess->x11port - X11BASEPORT, chansess->x11screennum); |
170 if (val < 0 || val >= (int)sizeof(display)) { | 170 if (val < 0 || val >= (int)sizeof(display)) { |
171 /* string was truncated */ | 171 /* string was truncated */ |
172 return; | 172 return; |
173 } | 173 } |
174 | 174 |
175 addnewvar("DISPLAY", display); | 175 addnewvar("DISPLAY", display); |
176 | 176 |
177 /* create the xauth string */ | 177 /* create the xauth string */ |
178 val = snprintf(display, sizeof(display), "unix:%d.%d", | 178 val = snprintf(display, sizeof(display), "unix:%d.%u", |
179 chansess->x11port - X11BASEPORT, chansess->x11screennum); | 179 chansess->x11port - X11BASEPORT, chansess->x11screennum); |
180 if (val < 0 || val >= (int)sizeof(display)) { | 180 if (val < 0 || val >= (int)sizeof(display)) { |
181 /* string was truncated */ | 181 /* string was truncated */ |
182 return; | 182 return; |
183 } | 183 } |