summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/packettest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/packettest.c b/test/packettest.c
index b82b9fb502..17831d940b 100644
--- a/test/packettest.c
+++ b/test/packettest.c
@@ -12,13 +12,13 @@
#define BUF_LEN 255
-static unsigned char smbuf[BUF_LEN];
+static unsigned char smbuf[BUF_LEN + 1];
static int test_PACKET_remaining(void)
{
PACKET pkt;
- if (!TEST_true(PACKET_buf_init(&pkt, smbuf, sizeof(smbuf)))
+ if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))
|| !TEST_size_t_eq(PACKET_remaining(&pkt), BUF_LEN)
|| !TEST_true(PACKET_forward(&pkt, BUF_LEN - 1))
|| !TEST_size_t_eq(PACKET_remaining(&pkt), 1)
@@ -33,7 +33,7 @@ static int test_PACKET_end(void)
{
PACKET pkt;
- if (!TEST_true(PACKET_buf_init(&pkt, smbuf, sizeof(smbuf)))
+ if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))
|| !TEST_size_t_eq(PACKET_remaining(&pkt), BUF_LEN)
|| !TEST_ptr_eq(PACKET_end(&pkt), smbuf + BUF_LEN)
|| !TEST_true(PACKET_forward(&pkt, BUF_LEN - 1))