diff --git a/src/bridge.c b/src/bridge.c index 6d38fe2..80496db 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -52,7 +52,7 @@ int parse_ip_data(modem_config *cfg, unsigned char *data, int len) // I'm going to cheat and assume it comes in chunks. int i = 0; int ch; - char text[1025]; + unsigned char text[1025]; int text_len = 0; diff --git a/src/debug.h b/src/debug.h index 05b490f..0bf8671 100644 --- a/src/debug.h +++ b/src/debug.h @@ -52,7 +52,7 @@ void log_set_file(FILE * a); void log_set_level(int a); int log_get_trace_flags(); void log_set_trace_flags(int a); -void log_trace(int type, char *line, int len); +void log_trace(int type, unsigned char *line, int len); void log_start(int level); void log_end(); diff --git a/src/ip.h b/src/ip.h index ce87559..9fd9b48 100644 --- a/src/ip.h +++ b/src/ip.h @@ -11,7 +11,7 @@ extern int ip_init_server_conn(char *ip_addr, int port); extern int ip_connect(char addy[]); extern int ip_accept(int sSocket); extern int ip_disconnect(int fd); -extern int ip_write(int fd, char *data, int len); -extern int ip_read(int fd, char *data, int len); +extern int ip_write(int fd, unsigned char *data, int len); +extern int ip_read(int fd, unsigned char *data, int len); #endif diff --git a/src/ip232.c b/src/ip232.c index 9fd270d..1c3e069 100644 --- a/src/ip232.c +++ b/src/ip232.c @@ -133,7 +133,7 @@ int ip232_get_control_lines(modem_config *cfg) int ip232_set_control_lines(modem_config *cfg, int state) { int dcd; - char cmd[2]; + unsigned char cmd[2]; if (cfg->dce_data.ip232_is_connected) { @@ -148,12 +148,12 @@ int ip232_set_control_lines(modem_config *cfg, int state) return 0; } -int ip232_write(modem_config *cfg, char *data, int len) +int ip232_write(modem_config *cfg, unsigned char *data, int len) { int retval; int i = 0; int double_iac = FALSE; - char text[1024]; + unsigned char text[1024]; int text_len = 0; @@ -187,11 +187,11 @@ int ip232_write(modem_config *cfg, char *data, int len) return retval; } -int ip232_read(modem_config *cfg, char *data, int len) +int ip232_read(modem_config *cfg, unsigned char *data, int len) { int res; int rc; - char buf[256]; + unsigned char buf[256]; int i = 0; int ch; int text_len = 0; diff --git a/src/ip232.h b/src/ip232.h index ea6ab9c..fabd30e 100644 --- a/src/ip232.h +++ b/src/ip232.h @@ -12,7 +12,7 @@ int ip232_init_conn(modem_config *); int ip232_set_flow_control(modem_config *, int status); int ip232_get_control_lines(modem_config *); int ip232_set_control_lines(modem_config *, int state); -int ip232_write(modem_config *, char *data, int len); -int ip232_read(modem_config *, char *data, int len); +int ip232_write(modem_config *, unsigned char *data, int len); +int ip232_read(modem_config *, unsigned char *data, int len); #endif /* */ diff --git a/src/line.c b/src/line.c index 3dd407f..c829426 100644 --- a/src/line.c +++ b/src/line.c @@ -20,7 +20,7 @@ int line_write(modem_config *cfg, char *data, int len) int retval; int i = 0; int double_iac = FALSE; - char text[1024]; + unsigned char text[1024]; int text_len = 0; int mask = 0x7f; int ch; diff --git a/src/modem_core.h b/src/modem_core.h index 65c88dd..8c7360a 100644 --- a/src/modem_core.h +++ b/src/modem_core.h @@ -154,7 +154,7 @@ int get_new_cts_state(modem_config *cfg, int up); int get_new_dsr_state(modem_config *cfg, int up); int get_new_dcd_state(modem_config *cfg, int up); int mdm_set_control_lines(modem_config *cfg); -void mdm_write(modem_config *cfg, char data[], int len); +void mdm_write(modem_config *cfg, unsigned char data[], int len); void mdm_send_response(int msg, modem_config *cfg); int mdm_off_hook(modem_config *cfg); int mdm_answer(modem_config *cfg); diff --git a/src/nvt.c b/src/nvt.c index 5902a4a..2e7bb45 100644 --- a/src/nvt.c +++ b/src/nvt.c @@ -19,7 +19,7 @@ void nvt_init_config(nvt_vars *vars) int get_nvt_cmd_response(int action, int type) { - char rc = 0; + unsigned char rc = 0; if (type == TRUE) { @@ -57,8 +57,8 @@ int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, i { // overflow issue, again... nvtOption opt = data[2]; - char resp[100]; - char *response = resp + 3; + unsigned char resp[100]; + unsigned char *response = resp + 3; int resp_len = 0; int response_len = 0; char tty_type[] = "VT100"; @@ -86,14 +86,14 @@ int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, i switch (opt) { case NVT_OPT_TERMINAL_TYPE: slen = strlen(tty_type); - strncpy(response + response_len, tty_type, slen); + strncpy((char *) response + response_len, tty_type, slen); response_len += slen; break; case NVT_OPT_TERMINAL_SPEED: sprintf(buf, "%i,%i", speed, speed); slen = strlen(buf); - strncpy(response + response_len, buf, slen); + strncpy((char *) response + response_len, buf, slen); response_len += slen; break; @@ -120,9 +120,9 @@ int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, i return rc; } -void send_nvt_command(int fd, nvt_vars *vars, char action, int opt) +void send_nvt_command(int fd, nvt_vars *vars, unsigned char action, int opt) { - char cmd[3]; + unsigned char cmd[3]; cmd[0] = NVT_IAC; @@ -137,7 +137,7 @@ void send_nvt_command(int fd, nvt_vars *vars, char action, int opt) void parse_nvt_command(int fd, nvt_vars *vars, nvtCommand action, nvtOption opt, int parity) { - char resp[3]; + unsigned char resp[3]; int accept = FALSE; diff --git a/src/nvt.h b/src/nvt.h index 2506a43..2686eb2 100644 --- a/src/nvt.h +++ b/src/nvt.h @@ -45,13 +45,13 @@ typedef enum { typedef struct nvt_vars { int binary_xmit; int binary_recv; - char term[256]; + unsigned char term[256]; } nvt_vars; extern void nvt_init_config(nvt_vars *vars); extern int get_nvt_cmd_response(int action, int type); extern int parse_nvt_subcommand(int fd, nvt_vars *vars, unsigned char *data, int len, int speed); -extern void send_nvt_command(int fd, nvt_vars *vars, char action, int opt); +extern void send_nvt_command(int fd, nvt_vars *vars, unsigned char action, int opt); extern void parse_nvt_command(int fd, nvt_vars *vars, nvtCommand action, nvtOption opt, int parity); #endif