X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/8afe456df0b0ccd989631f6f6e35f61e9abedea0..5c0d0e9043850dd5af5d974e2c95c359c640c9f3:/msg.c diff --git a/msg.c b/msg.c index a159aae8..de19b057 100644 --- a/msg.c +++ b/msg.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.1 2002/05/23 19:24:30 markus Exp $"); +RCSID("$OpenBSD: msg.c,v 1.4 2002/07/01 16:15:25 deraadt Exp $"); #include "buffer.h" #include "getput.h" @@ -36,10 +36,10 @@ msg_send(int fd, u_char type, Buffer *m) u_char buf[5]; u_int mlen = buffer_len(m); - debug3("msg_send: type %d", type); + debug3("msg_send: type %u", (unsigned int)type & 0xff); PUT_32BIT(buf, mlen + 1); - buf[4] = type; /* 1st byte of payload is mesg-type */ + buf[4] = type; /* 1st byte of payload is mesg-type */ if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf)) fatal("msg_send: write"); if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) @@ -59,11 +59,11 @@ msg_recv(int fd, Buffer *m) if (res != sizeof(buf)) { if (res == 0) return -1; - fatal("msg_recv: read: header %d", res); + fatal("msg_recv: read: header %ld", (long)res); } msg_len = GET_32BIT(buf); if (msg_len > 256 * 1024) - fatal("msg_recv: read: bad msg_len %d", msg_len); + fatal("msg_recv: read: bad msg_len %u", msg_len); buffer_clear(m); buffer_append_space(m, msg_len); res = atomicio(read, fd, buffer_ptr(m), msg_len);