25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Make jlib:ip_to_list safe to use

This commit is contained in:
Alexey Shchepin 2010-12-20 17:56:24 +02:00
parent b9f4daca46
commit b47c50145d

View File

@ -803,4 +803,6 @@ ip_to_list({_,_,_,_,_,_,_,_} = Ipv6Address) ->
inet_parse:ntoa(Ipv6Address);
%% This function clause could use inet_parse too:
ip_to_list({A,B,C,D}) ->
lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D])).
lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D]));
ip_to_list(IP) ->
lists:flatten(io_lib:format("~w", [IP])).