Fix running on big endian

RFC2217 options with one byte values were always sent with value = 0.
This commit is contained in:
Kim Woelders
2018-10-22 11:09:12 +02:00
parent 85394b243e
commit effca015a8
3 changed files with 17 additions and 12 deletions
+4 -2
View File
@@ -43,10 +43,12 @@ void telnet_rfc2217_cfg(tn_ctx_t * tcc, int cmd, const void *val, int nd)
telnet_set_opt(tcc, TNO_CPCO, cmd, val, nd);
}
void telnet_rfc2217_ctl(tn_ctx_t * tcc, int cmd)
void telnet_rfc2217_ctl(tn_ctx_t * tcc, unsigned int val)
{
unsigned char byte = val;
if (!tcc->mode_rfc2217)
return;
telnet_set_opt(tcc, TNO_CPCO, TNS_SET_CONTROL, &cmd, 1);
telnet_set_opt(tcc, TNO_CPCO, TNS_SET_CONTROL, &byte, 1);
}