diff options
| author | Alexey Shchepin <alexey@process-one.net> | 2010-12-20 17:56:24 +0200 |
|---|---|---|
| committer | Badlop <badlop@process-one.net> | 2010-12-23 13:17:14 +0100 |
| commit | bb4a87806fd25a60c3a6f9ba3c9475510144ed88 (patch) | |
| tree | 2ea1ee419223d80c4021773900f12c6ab5bdaf9e | |
| parent | Clean muc_online_room when mod_muc starts (EJAB-1365) (diff) | |
Make jlib:ip_to_list safe to use
| -rw-r--r-- | src/jlib.erl | 4 |
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. |
