comparison svr-x11fwd.c @ 1239:00d7fc7b112b

Merge pull request #21 from Chocobo1/fix Fix warnings
author Matt Johnston <matt@ucc.asn.au>
date Wed, 20 Jan 2016 21:24:36 +0800
parents 888e3d17e962
children 428d83f2e5db
comparison
equal deleted inserted replaced
1228:f7f2c3714269 1239:00d7fc7b112b
140 if (chansess->x11listener == NULL) { 140 if (chansess->x11listener == NULL) {
141 return; 141 return;
142 } 142 }
143 143
144 /* create the DISPLAY string */ 144 /* create the DISPLAY string */
145 val = snprintf(display, sizeof(display), "localhost:%d.%d", 145 val = snprintf(display, sizeof(display), "localhost:%d.%u",
146 chansess->x11port - X11BASEPORT, chansess->x11screennum); 146 chansess->x11port - X11BASEPORT, chansess->x11screennum);
147 if (val < 0 || val >= (int)sizeof(display)) { 147 if (val < 0 || val >= (int)sizeof(display)) {
148 /* string was truncated */ 148 /* string was truncated */
149 return; 149 return;
150 } 150 }
151 151
152 addnewvar("DISPLAY", display); 152 addnewvar("DISPLAY", display);
153 153
154 /* create the xauth string */ 154 /* create the xauth string */
155 val = snprintf(display, sizeof(display), "unix:%d.%d", 155 val = snprintf(display, sizeof(display), "unix:%d.%u",
156 chansess->x11port - X11BASEPORT, chansess->x11screennum); 156 chansess->x11port - X11BASEPORT, chansess->x11screennum);
157 if (val < 0 || val >= (int)sizeof(display)) { 157 if (val < 0 || val >= (int)sizeof(display)) {
158 /* string was truncated */ 158 /* string was truncated */
159 return; 159 return;
160 } 160 }