Skip to content

Commit c32abd2

Browse files
committed
M322: SN_Decode_Register
1 parent 3b720a1 commit c32abd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mqtt_sn_packet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ int SN_Decode_Register(byte *rx_buf, int rx_buf_len, SN_Register *regist)
810810
regist->topicName = (char*)rx_payload;
811811

812812
/* Terminate the string */
813-
rx_payload[total_len-6] = '\0';
813+
rx_payload[total_len - (rx_payload - rx_buf)] = '\0';
814814
}
815815
(void)rx_payload;
816816

0 commit comments

Comments
 (0)