From 51ee11ef3bf68e86bf1cabdbb97872db2d06fc62 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Mon, 20 Aug 2018 00:49:27 +0800 Subject: buffer_append_be*: return 1 on success --- src/protocol/internal/buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/protocol/internal/buffer.c b/src/protocol/internal/buffer.c index dc53781..21d59a7 100644 --- a/src/protocol/internal/buffer.c +++ b/src/protocol/internal/buffer.c @@ -78,6 +78,7 @@ int buffer_append_byte(buffer *b, uint8_t x) if (ensure(b, 1)) { b->p[b->offs + b->sz] = x; b->sz += 1; + return 1; } else { return 0; } @@ -89,6 +90,7 @@ int buffer_append_be16(buffer *b, uint16_t x) if (ensure(b, 2)) { *(uint16_t *)(b->p + b->offs + b->sz) = beint; b->sz += 2; + return 1; } else { return 0; } @@ -100,6 +102,7 @@ int buffer_append_be32(buffer *b, uint32_t x) if (ensure(b, 4)) { *(uint32_t *)(b->p + b->offs + b->sz) = beint; b->sz += 4; + return 1; } else { return 0; } -- cgit v1.2.3