diff --git a/chansession.h b/chansession.h
index 66f5504fe89033fc33fae073f788970cf6e92d4e..6eb8c76486a61027e4483c647ba70c500eab010d 100644
--- a/chansession.h
+++ b/chansession.h
@@ -39,7 +39,7 @@ struct exitinfo {
 
 struct ChanSess {
 
-	unsigned char * cmd; /* command to exec */
+	char * cmd; /* command to exec */
 	pid_t pid; /* child process pid */
 
 	/* pty details */
diff --git a/svr-chansession.c b/svr-chansession.c
index c496ff91c617eefff1b36e9248a17eb9fe5c1270..a630112e925756b6070747b115517884194a9886 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -649,7 +649,7 @@ static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
 	if (iscmd) {
 		/* "exec" */
 		if (chansess->cmd == NULL) {
-			chansess->cmd = buf_getstring(ses.payload, &cmdlen);
+			chansess->cmd = (char *) buf_getstring(ses.payload, &cmdlen);
 
 			if (cmdlen > MAX_CMD_LEN) {
 				m_free(chansess->cmd);