Bugfix: Subscribe package was 2 bytes short

This commit is contained in:
Johannes Schriewer 2018-07-28 17:58:45 +02:00
parent 6590736a9d
commit c82b157c15

View file

@ -430,7 +430,7 @@ Buffer *encode_pubcomp(PubCompPayload *payload) {
Buffer *encode_subscribe(SubscribePayload *payload) {
size_t sz = 2; // packet id
sz += strlen(payload->topic); // topic
sz += strlen(payload->topic) + 2; // topic
sz += 1; // qos level
Buffer *buffer = make_buffer_for_header(sz, PacketTypeSubscribe);