aboutsummaryrefslogtreecommitdiff
path: root/shared/protocol.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-28 14:31:56 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-28 14:31:56 +0200
commitbabb6dc29a5c4af60292ffad5216317d13e2a685 (patch)
treed5de3240e0112310c5ffc90ead6935333d5f9f78 /shared/protocol.c
parent4cd465332087e4ab12709f28fae55df10e1a1154 (diff)
fix off-by-one error and create macro for switching serial debug print color
Diffstat (limited to 'shared/protocol.c')
-rw-r--r--shared/protocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/protocol.c b/shared/protocol.c
index e17a728..8887070 100644
--- a/shared/protocol.c
+++ b/shared/protocol.c
@@ -142,6 +142,6 @@ unsigned short ws_protocol_get_header_size(ws_s_protocol_res* response) {
unsigned short size = 2; // comma and trailing newline
if (response->success == WS_PROTOCOL_CMD_RETURN_OK) size += 2; // ok
if (response->success == WS_PROTOCOL_CMD_RETURN_ERROR) size += 5; // error
- size += ws_log16(response->msg->bytes); // amount of characters for message size (hex)
+ size += ws_log16(response->msg->bytes) + 1; // amount of characters for message size (hex)
return size;
} \ No newline at end of file