From 01794c2d2c7d77a73889b5bad58cc92854b7282f Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 8 Feb 2022 17:48:19 -0300 Subject: [PATCH] fix(ctl): fix formatting when printing messages without arguments Without passing an empty argument list to `emqx_ctl:print`, formatting instructions like `~n` are being printed literally. ``` Ignore.~nJoin the cluster successfully.~nCluster status: #{running_nodes => ['emqx@emqx-0.int.thalesmg','emqx@emqx-1.int.thalesmg', 'emqx@emqx-2.int.thalesmg','emqx@emqx-3.int.thalesmg', 'emqx@emqx-4.int.thalesmg'], stopped_nodes => []} ``` --- apps/emqx/src/emqx_ctl.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/emqx/src/emqx_ctl.erl b/apps/emqx/src/emqx_ctl.erl index 74b72c193..b6dfefffe 100644 --- a/apps/emqx/src/emqx_ctl.erl +++ b/apps/emqx/src/emqx_ctl.erl @@ -139,7 +139,7 @@ help() -> -spec(print(io:format()) -> ok). print(Msg) -> - io:format("~ts", [format(Msg)]). + io:format("~ts", [format(Msg, [])]). -spec(print(io:format(), [term()]) -> ok). print(Format, Args) -> @@ -243,4 +243,3 @@ zip_cmd([X | Xs], [Y | Ys]) -> [{X, Y} | zip_cmd(Xs, Ys)]; zip_cmd([X | Xs], []) -> [{X, ""} | zip_cmd(Xs, [])]; zip_cmd([], [Y | Ys]) -> [{"", Y} | zip_cmd([], Ys)]; zip_cmd([], []) -> []. -