diff --git a/marshal.c b/marshal.c index a8371b66..f0612a85 100644 --- a/marshal.c +++ b/marshal.c @@ -11,7 +11,7 @@ void BinarySink_put_data(BinarySink *bs, const void *data, size_t len) bs->write(bs, data, len); } -void BinarySink_put_padding(BinarySink *bs, unsigned char padbyte, size_t len) +void BinarySink_put_padding(BinarySink *bs, size_t len, unsigned char padbyte) { char buf[16]; memset(buf, padbyte, sizeof(buf)); diff --git a/marshal.h b/marshal.h index 0debe82f..2aa0301a 100644 --- a/marshal.h +++ b/marshal.h @@ -111,8 +111,8 @@ struct BinarySink { BinarySink_put_mp_ssh2(BinarySink_UPCAST(bs), val) /* Padding with a specified byte. */ -#define put_padding(bs, padbyte, len) \ - BinarySink_put_padding(BinarySink_UPCAST(bs), padbyte, len) +#define put_padding(bs, len, padbyte) \ + BinarySink_put_padding(BinarySink_UPCAST(bs), len, padbyte) /* Fallback: just emit raw data bytes, using a syntax that matches the * rest of these macros. */ @@ -130,7 +130,7 @@ struct BinarySink { * declaration(s) of their other parameter type(s) are in scope. */ void BinarySink_put_data(BinarySink *, const void *data, size_t len); -void BinarySink_put_padding(BinarySink *, unsigned char padbyte, size_t len); +void BinarySink_put_padding(BinarySink *, size_t len, unsigned char padbyte); void BinarySink_put_byte(BinarySink *, unsigned char); void BinarySink_put_bool(BinarySink *, int); void BinarySink_put_uint16(BinarySink *, unsigned long); diff --git a/ssh2bpp.c b/ssh2bpp.c index da0ac900..0ea1f793 100644 --- a/ssh2bpp.c +++ b/ssh2bpp.c @@ -582,7 +582,7 @@ static void ssh2_bpp_format_packet(BinaryPacketProtocol *bpp, PktOut *pkt) s->out.sequence); } - put_padding(pkt, 0, maclen); + put_padding(pkt, maclen, 0); if (s->out.mac && s->out.etm_mode) { /*