comparison cli-chansession.c @ 1117:6b6ed65e99b1

Turn type and term local variables into char *
author Gaël PORTAY <gael.portay@gmail.com>
date Sun, 03 May 2015 00:01:36 +0200
parents 93e29b0ef8dc
children aaf576b27a10
comparison
equal deleted inserted replaced
1116:3d9519ec2b85 1117:6b6ed65e99b1
54 cli_closechansess, /* closehandler */ 54 cli_closechansess, /* closehandler */
55 }; 55 };
56 56
57 static void cli_chansessreq(struct Channel *channel) { 57 static void cli_chansessreq(struct Channel *channel) {
58 58
59 unsigned char* type = NULL; 59 char* type = NULL;
60 int wantreply; 60 int wantreply;
61 61
62 TRACE(("enter cli_chansessreq")) 62 TRACE(("enter cli_chansessreq"))
63 63
64 type = buf_getstring(ses.payload, NULL); 64 type = (char *) buf_getstring(ses.payload, NULL);
65 wantreply = buf_getbool(ses.payload); 65 wantreply = buf_getbool(ses.payload);
66 66
67 if (strcmp(type, "exit-status") == 0) { 67 if (strcmp(type, "exit-status") == 0) {
68 cli_ses.retval = buf_getint(ses.payload); 68 cli_ses.retval = buf_getint(ses.payload);
69 TRACE(("got exit-status of '%d'", cli_ses.retval)) 69 TRACE(("got exit-status of '%d'", cli_ses.retval))
270 cli_ses.winchange = 0; 270 cli_ses.winchange = 0;
271 } 271 }
272 272
273 static void send_chansess_pty_req(struct Channel *channel) { 273 static void send_chansess_pty_req(struct Channel *channel) {
274 274
275 unsigned char* term = NULL; 275 char* term = NULL;
276 276
277 TRACE(("enter send_chansess_pty_req")) 277 TRACE(("enter send_chansess_pty_req"))
278 278
279 start_send_channel_request(channel, "pty-req"); 279 start_send_channel_request(channel, "pty-req");
280 280
284 /* Get the terminal */ 284 /* Get the terminal */
285 term = getenv("TERM"); 285 term = getenv("TERM");
286 if (term == NULL) { 286 if (term == NULL) {
287 term = "vt100"; /* Seems a safe default */ 287 term = "vt100"; /* Seems a safe default */
288 } 288 }
289 buf_putstring(ses.writepayload, term, strlen(term)); 289 buf_putstring(ses.writepayload, (const unsigned char *)term, strlen(term));
290 290
291 /* Window size */ 291 /* Window size */
292 put_winsize(); 292 put_winsize();
293 293
294 /* Terminal mode encoding */ 294 /* Terminal mode encoding */