aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2010-12-20 17:56:24 +0200
committerBadlop <badlop@process-one.net>2010-12-23 13:17:14 +0100
commitbb4a87806fd25a60c3a6f9ba3c9475510144ed88 (patch)
tree2ea1ee419223d80c4021773900f12c6ab5bdaf9e
parentClean muc_online_room when mod_muc starts (EJAB-1365) (diff)
Make jlib:ip_to_list safe to use
-rw-r--r--src/jlib.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jlib.erl b/src/jlib.erl
index 76a04fe53..2277fb9e4 100644
--- a/src/jlib.erl
+++ b/src/jlib.erl
@@ -392,7 +392,9 @@ e(X) -> exit({bad_encode_base64_token, X}).
ip_to_list({IP, _Port}) ->
ip_to_list(IP);
ip_to_list(IpTuple) when is_tuple(IpTuple) ->
- inet_parse:ntoa(IpTuple).
+ inet_parse:ntoa(IpTuple);
+ip_to_list(IP) ->
+ lists:flatten(io_lib:format("~w", [IP])).
% --------------------------------------------------------------------
% Compat layer.