summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony Garnock-Jones <tonyg@lshift.net>2009-09-18 12:55:21 +0100
committerTony Garnock-Jones <tonyg@lshift.net>2009-09-18 12:55:21 +0100
commit19ab5590797d1d37dddbe4449ce2f17cd4405387 (patch)
tree25dccce47bc6c30d3c941da4f634038240995a73 /src
parent08e35ea4e7d9566ee046a16d8621e92b278d2562 (diff)
downloadrabbitmq-server-git-19ab5590797d1d37dddbe4449ce2f17cd4405387.tar.gz
Escape atoms as lists and binaries are.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_control.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index ac7e3eaa9c..69e91803d6 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -338,7 +338,7 @@ format_info_item(Key, Items) ->
Value when is_binary(Value) ->
escape(Value);
Value when is_atom(Value) ->
- io_lib:format("~s", [Value]);
+ escape(atom_to_list(Value));
Value ->
io_lib:format("~w", [Value])
end.
@@ -365,7 +365,9 @@ rpc_call(Node, Mod, Fun, Args) ->
%% form part of UTF-8 strings.
escape(Bin) when binary(Bin) ->
- escape_char(lists:reverse(binary_to_list(Bin)), []).
+ escape(binary_to_list(Bin));
+escape(L) when is_list(L) ->
+ escape_char(lists:reverse(L), []).
escape_char([$\\ | T], Acc) ->
escape_char(T, [$\\, $\\ | Acc]);