From 262ac3fb5bef0a5b8c4dbae464782919adf0dc09 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 10 Oct 2018 17:53:19 +0100 Subject: [PATCH] Fix varint length reporting. --- lib/property_mosq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/property_mosq.c b/lib/property_mosq.c index d5ce5631..74fbd662 100644 --- a/lib/property_mosq.c +++ b/lib/property_mosq.c @@ -310,13 +310,13 @@ int property__get_length(struct mqtt5__property *property) case PROP_SUBSCRIPTION_IDENTIFIER: if(property->value.varint < 128){ - return 1; - }else if(property->value.varint < 16384){ return 2; - }else if(property->value.varint < 2097152){ + }else if(property->value.varint < 16384){ return 3; - }else if(property->value.varint < 268435456){ + }else if(property->value.varint < 2097152){ return 4; + }else if(property->value.varint < 268435456){ + return 5; }else{ return 0; }