mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Theo Markettos's unsigned-vs-signed-char pedantry patch.
[originally from svn r3753]
This commit is contained in:
parent
a326264500
commit
4dec95f80f
12
portfwd.c
12
portfwd.c
@ -255,7 +255,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
if (pr->hostname[1] != 1 || pr->hostname[2] != 0) {
|
if (pr->hostname[1] != 1 || pr->hostname[2] != 0) {
|
||||||
/* Not CONNECT or reserved field nonzero - error */
|
/* Not CONNECT or reserved field nonzero - error */
|
||||||
reply[1] = 1; /* generic failure */
|
reply[1] = 1; /* generic failure */
|
||||||
sk_write(pr->s, reply, lenof(reply));
|
sk_write(pr->s, (char *) reply, lenof(reply));
|
||||||
pfd_close(pr->s);
|
pfd_close(pr->s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
pr->port = GET_16BIT_MSB_FIRST(pr->hostname+4+alen);
|
pr->port = GET_16BIT_MSB_FIRST(pr->hostname+4+alen);
|
||||||
if (atype == 1) {
|
if (atype == 1) {
|
||||||
/* REP=0 (success) already */
|
/* REP=0 (success) already */
|
||||||
sk_write(pr->s, reply, lenof(reply));
|
sk_write(pr->s, (char *) reply, lenof(reply));
|
||||||
sprintf(pr->hostname, "%d.%d.%d.%d",
|
sprintf(pr->hostname, "%d.%d.%d.%d",
|
||||||
(unsigned char)pr->hostname[4],
|
(unsigned char)pr->hostname[4],
|
||||||
(unsigned char)pr->hostname[5],
|
(unsigned char)pr->hostname[5],
|
||||||
@ -275,7 +275,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
goto connect;
|
goto connect;
|
||||||
} else if (atype == 3) {
|
} else if (atype == 3) {
|
||||||
/* REP=0 (success) already */
|
/* REP=0 (success) already */
|
||||||
sk_write(pr->s, reply, lenof(reply));
|
sk_write(pr->s, (char *) reply, lenof(reply));
|
||||||
memmove(pr->hostname, pr->hostname + 5, alen-1);
|
memmove(pr->hostname, pr->hostname + 5, alen-1);
|
||||||
pr->hostname[alen-1] = '\0';
|
pr->hostname[alen-1] = '\0';
|
||||||
goto connect;
|
goto connect;
|
||||||
@ -284,13 +284,13 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
* Unknown address type. (FIXME: support IPv6!)
|
* Unknown address type. (FIXME: support IPv6!)
|
||||||
*/
|
*/
|
||||||
reply[1] = 8; /* atype not supported */
|
reply[1] = 8; /* atype not supported */
|
||||||
sk_write(pr->s, reply, lenof(reply));
|
sk_write(pr->s, (char *) reply, lenof(reply));
|
||||||
pfd_close(pr->s);
|
pfd_close(pr->s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we get here without either having done `continue'
|
* If we get here without either having done `continue'
|
||||||
* or `goto connect', it must be because there is no
|
* or `goto connect', it must be because there is no
|
||||||
|
2
psftp.c
2
psftp.c
@ -1741,7 +1741,7 @@ int sftp_recvdata(char *buf, int len)
|
|||||||
}
|
}
|
||||||
int sftp_senddata(char *buf, int len)
|
int sftp_senddata(char *buf, int len)
|
||||||
{
|
{
|
||||||
back->send(backhandle, (unsigned char *) buf, len);
|
back->send(backhandle, buf, len);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
22
scp.c
22
scp.c
@ -290,7 +290,7 @@ static void bump(char *fmt, ...)
|
|||||||
if (back != NULL && back->socket(backhandle) != NULL) {
|
if (back != NULL && back->socket(backhandle) != NULL) {
|
||||||
char ch;
|
char ch;
|
||||||
back->special(backhandle, TS_EOF);
|
back->special(backhandle, TS_EOF);
|
||||||
ssh_scp_recv(&ch, 1);
|
ssh_scp_recv((unsigned char *) &ch, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gui_mode)
|
if (gui_mode)
|
||||||
@ -455,7 +455,7 @@ static void print_stats(char *name, unsigned long size, unsigned long done,
|
|||||||
pct = (int) (100 * (done * 1.0 / size));
|
pct = (int) (100 * (done * 1.0 / size));
|
||||||
|
|
||||||
if (gui_mode) {
|
if (gui_mode) {
|
||||||
gui_update_stats(name, size, pct, elap, done, eta,
|
gui_update_stats(name, size, pct, elap, done, eta,
|
||||||
(unsigned long) ratebs);
|
(unsigned long) ratebs);
|
||||||
} else {
|
} else {
|
||||||
len = printf("\r%-25.25s | %10ld kB | %5.1f kB/s | ETA: %8s | %3d%%",
|
len = printf("\r%-25.25s | %10ld kB | %5.1f kB/s | ETA: %8s | %3d%%",
|
||||||
@ -531,7 +531,7 @@ static int response(void)
|
|||||||
char ch, resp, rbuf[2048];
|
char ch, resp, rbuf[2048];
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
if (ssh_scp_recv(&resp, 1) <= 0)
|
if (ssh_scp_recv((unsigned char *) &resp, 1) <= 0)
|
||||||
bump("Lost connection");
|
bump("Lost connection");
|
||||||
|
|
||||||
p = 0;
|
p = 0;
|
||||||
@ -544,7 +544,7 @@ static int response(void)
|
|||||||
case 1: /* error */
|
case 1: /* error */
|
||||||
case 2: /* fatal error */
|
case 2: /* fatal error */
|
||||||
do {
|
do {
|
||||||
if (ssh_scp_recv(&ch, 1) <= 0)
|
if (ssh_scp_recv((unsigned char *) &ch, 1) <= 0)
|
||||||
bump("Protocol error: Lost connection");
|
bump("Protocol error: Lost connection");
|
||||||
rbuf[p++] = ch;
|
rbuf[p++] = ch;
|
||||||
} while (p < sizeof(rbuf) && ch != '\n');
|
} while (p < sizeof(rbuf) && ch != '\n');
|
||||||
@ -560,11 +560,11 @@ static int response(void)
|
|||||||
|
|
||||||
int sftp_recvdata(char *buf, int len)
|
int sftp_recvdata(char *buf, int len)
|
||||||
{
|
{
|
||||||
return ssh_scp_recv(buf, len);
|
return ssh_scp_recv((unsigned char *) buf, len);
|
||||||
}
|
}
|
||||||
int sftp_senddata(char *buf, int len)
|
int sftp_senddata(char *buf, int len)
|
||||||
{
|
{
|
||||||
back->send(backhandle, (unsigned char *) buf, len);
|
back->send(backhandle, buf, len);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1320,14 +1320,14 @@ int scp_get_sink_action(struct scp_sink_action *act)
|
|||||||
bufsize = 0;
|
bufsize = 0;
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
if (ssh_scp_recv(&ch, 1) <= 0)
|
if (ssh_scp_recv((unsigned char *) &ch, 1) <= 0)
|
||||||
return 1;
|
return 1;
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
bump("Protocol error: Unexpected newline");
|
bump("Protocol error: Unexpected newline");
|
||||||
i = 0;
|
i = 0;
|
||||||
action = ch;
|
action = ch;
|
||||||
do {
|
do {
|
||||||
if (ssh_scp_recv(&ch, 1) <= 0)
|
if (ssh_scp_recv((unsigned char *) &ch, 1) <= 0)
|
||||||
bump("Lost connection");
|
bump("Lost connection");
|
||||||
if (i >= bufsize) {
|
if (i >= bufsize) {
|
||||||
bufsize = i + 128;
|
bufsize = i + 128;
|
||||||
@ -1442,7 +1442,7 @@ int scp_recv_filedata(char *data, int len)
|
|||||||
|
|
||||||
return actuallen;
|
return actuallen;
|
||||||
} else {
|
} else {
|
||||||
return ssh_scp_recv(data, len);
|
return ssh_scp_recv((unsigned char *) data, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2034,7 +2034,7 @@ static void get_dir_list(int argc, char *argv[])
|
|||||||
if (using_sftp) {
|
if (using_sftp) {
|
||||||
scp_sftp_listdir(src);
|
scp_sftp_listdir(src);
|
||||||
} else {
|
} else {
|
||||||
while (ssh_scp_recv(&c, 1) > 0)
|
while (ssh_scp_recv((unsigned char *) &c, 1) > 0)
|
||||||
tell_char(stdout, c);
|
tell_char(stdout, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2171,7 +2171,7 @@ int psftp_main(int argc, char *argv[])
|
|||||||
if (back != NULL && back->socket(backhandle) != NULL) {
|
if (back != NULL && back->socket(backhandle) != NULL) {
|
||||||
char ch;
|
char ch;
|
||||||
back->special(backhandle, TS_EOF);
|
back->special(backhandle, TS_EOF);
|
||||||
ssh_scp_recv(&ch, 1);
|
ssh_scp_recv((unsigned char *) &ch, 1);
|
||||||
}
|
}
|
||||||
random_save_seed();
|
random_save_seed();
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ static int net_select_result(int fd, int event)
|
|||||||
|
|
||||||
memset(&isa, 0, sizeof(struct sockaddr_in));
|
memset(&isa, 0, sizeof(struct sockaddr_in));
|
||||||
err = 0;
|
err = 0;
|
||||||
t = accept(s->s,(struct sockaddr *)&isa,&addrlen);
|
t = accept(s->s,(struct sockaddr *)&isa,(socklen_t *) &addrlen);
|
||||||
if (t < 0) {
|
if (t < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user