summaryrefslogtreecommitdiff
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
commitd314c99966c715b6949222863fff2f99513c575c (patch)
tree25dccce47bc6c30d3c941da4f634038240995a73
parentbe8e03e39b128ca8b48312110deddb0c71a839ad (diff)
downloadrabbitmq-server-bug21596.tar.gz
Escape atoms as lists and binaries are.bug21596
-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 ac7e3eaa..69e91803 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]);