summaryrefslogtreecommitdiffhomepage
path: root/src/chunklets/msg.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-08-26 20:27:48 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-27 00:46:09 +0100
commit531854eb1cf06aa17419c5c45dead8943153b195 (patch)
tree4860a2270036fef32896c8ddb6bb1ee25b6db44d /src/chunklets/msg.c
parenta1998f2f7ce4153d670e2e5cb5018366517cc1ca (diff)
Fix msgpack sizing blunders
Reminder not to actually use any of the code I write until it's at least been included in a few releases of something. :^)
Diffstat (limited to 'src/chunklets/msg.c')
-rw-r--r--src/chunklets/msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/chunklets/msg.c b/src/chunklets/msg.c
index 0e26a80..d99edc1 100644
--- a/src/chunklets/msg.c
+++ b/src/chunklets/msg.c
@@ -197,7 +197,7 @@ void msg_putssz5(unsigned char *out, int sz) {
}
int msg_putssz8(unsigned char *out, int sz) {
- if (sz < 64) { msg_putssz5(out, sz); return 1; }
+ if (sz < 32) { msg_putssz5(out, sz); return 1; }
out[0] = 0xD9;
out[1] = sz;
return 2;
@@ -241,7 +241,7 @@ void msg_putasz4(unsigned char *out, int sz) {
}
int msg_putasz16(unsigned char *out, int sz) {
- if (sz < 32) { msg_putasz4(out, sz); return 1; }
+ if (sz < 16) { msg_putasz4(out, sz); return 1; }
out[0] = 0xDC;
doput16(out, sz);
return 3;
@@ -259,7 +259,7 @@ void msg_putmsz4(unsigned char *out, int sz) {
}
int msg_putmsz16(unsigned char *out, int sz) {
- if (sz < 32) { msg_putmsz4(out, sz); return 1; }
+ if (sz < 16) { msg_putmsz4(out, sz); return 1; }
out[0] = 0xDE;
doput16(out, sz);
return 3;