Преглед изворни кода

chore(mqttsn): fix frame formating crash

JianBo He пре 4 година
родитељ
комит
01eb3ca93a
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      apps/emqx_gateway/src/mqttsn/emqx_sn_frame.erl

+ 2 - 2
apps/emqx_gateway/src/mqttsn/emqx_sn_frame.erl

@@ -362,9 +362,9 @@ format(?SN_REGACK_MSG(TopicId, MsgId, ReturnCode)) ->
 format(?SN_PINGREQ_MSG(ClientId)) ->
     io_lib:format("SN_PINGREQ(ClientId=~s)", [ClientId]);
 format(?SN_PINGRESP_MSG()) ->
-    "SN_PINGREQ()";
+    "SN_PINGRESP()";
 format(?SN_DISCONNECT_MSG(Duration)) ->
-    io_lib:format("SN_DISCONNECT(Duration=~s)", [Duration]);
+    io_lib:format("SN_DISCONNECT(Duration=~w)", [Duration]);
 
 format(#mqtt_sn_message{type = Type, variable = Var}) ->
     io_lib:format("mqtt_sn_message(type=~s, Var=~w)",