mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-18 19:41:01 -05:00
Make lots of 'int' length fields into size_t.
This is a general cleanup which has been overdue for some time: lots of length fields are now the machine word type rather than the (in practice) fixed 'int'.
This commit is contained in:
20
telnet.c
20
telnet.c
@ -182,7 +182,7 @@ struct Telnet {
|
||||
|
||||
bool echoing, editing;
|
||||
bool activated;
|
||||
int bufsize;
|
||||
size_t bufsize;
|
||||
bool in_synch;
|
||||
int sb_opt, sb_len;
|
||||
unsigned char *sb_buf;
|
||||
@ -206,10 +206,9 @@ struct Telnet {
|
||||
|
||||
#define SB_DELTA 1024
|
||||
|
||||
static void c_write(Telnet *telnet, const void *buf, int len)
|
||||
static void c_write(Telnet *telnet, const void *buf, size_t len)
|
||||
{
|
||||
int backlog;
|
||||
backlog = seat_stdout(telnet->seat, buf, len);
|
||||
size_t backlog = seat_stdout(telnet->seat, buf, len);
|
||||
sk_set_frozen(telnet->s, backlog > TELNET_MAX_BACKLOG);
|
||||
}
|
||||
|
||||
@ -506,7 +505,7 @@ static void process_subneg(Telnet *telnet)
|
||||
}
|
||||
}
|
||||
|
||||
static void do_telnet_read(Telnet *telnet, const char *buf, int len)
|
||||
static void do_telnet_read(Telnet *telnet, const char *buf, size_t len)
|
||||
{
|
||||
strbuf *outbuf = strbuf_new();
|
||||
|
||||
@ -654,7 +653,8 @@ static void telnet_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
/* Otherwise, the remote side closed the connection normally. */
|
||||
}
|
||||
|
||||
static void telnet_receive(Plug *plug, int urgent, const char *data, int len)
|
||||
static void telnet_receive(
|
||||
Plug *plug, int urgent, const char *data, size_t len)
|
||||
{
|
||||
Telnet *telnet = container_of(plug, Telnet, plug);
|
||||
if (urgent)
|
||||
@ -663,7 +663,7 @@ static void telnet_receive(Plug *plug, int urgent, const char *data, int len)
|
||||
do_telnet_read(telnet, data, len);
|
||||
}
|
||||
|
||||
static void telnet_sent(Plug *plug, int bufsize)
|
||||
static void telnet_sent(Plug *plug, size_t bufsize)
|
||||
{
|
||||
Telnet *telnet = container_of(plug, Telnet, plug);
|
||||
telnet->bufsize = bufsize;
|
||||
@ -815,7 +815,7 @@ static void telnet_reconfig(Backend *be, Conf *conf)
|
||||
/*
|
||||
* Called to send data down the Telnet connection.
|
||||
*/
|
||||
static int telnet_send(Backend *be, const char *buf, int len)
|
||||
static size_t telnet_send(Backend *be, const char *buf, size_t len)
|
||||
{
|
||||
Telnet *telnet = container_of(be, Telnet, backend);
|
||||
unsigned char *p, *end;
|
||||
@ -850,7 +850,7 @@ static int telnet_send(Backend *be, const char *buf, int len)
|
||||
/*
|
||||
* Called to query the current socket sendability status.
|
||||
*/
|
||||
static int telnet_sendbuffer(Backend *be)
|
||||
static size_t telnet_sendbuffer(Backend *be)
|
||||
{
|
||||
Telnet *telnet = container_of(be, Telnet, backend);
|
||||
return telnet->bufsize;
|
||||
@ -1009,7 +1009,7 @@ static bool telnet_sendok(Backend *be)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void telnet_unthrottle(Backend *be, int backlog)
|
||||
static void telnet_unthrottle(Backend *be, size_t backlog)
|
||||
{
|
||||
Telnet *telnet = container_of(be, Telnet, backend);
|
||||
sk_set_frozen(telnet->s, backlog > TELNET_MAX_BACKLOG);
|
||||
|
Reference in New Issue
Block a user