summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-08-20 00:49:27 +0800
committerIru Cai <mytbk920423@gmail.com>2018-08-20 00:49:27 +0800
commit51ee11ef3bf68e86bf1cabdbb97872db2d06fc62 (patch)
tree84ad81ec54a00f2f5ddeba14ae5655008da8451e
parent0cd50607f6fce34a97e6b61578a4994b709de4c5 (diff)
downloadfqterm-51ee11ef3bf68e86bf1cabdbb97872db2d06fc62.tar.xz
buffer_append_be*: return 1 on success
-rw-r--r--src/protocol/internal/buffer.c3
1 files changed, 3 insertions, 0 deletions
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;
}