From b47c50145d6c0b9643dc3d9578617e3231cdf793 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Mon, 20 Dec 2010 17:56:24 +0200 Subject: [PATCH] Make jlib:ip_to_list safe to use --- src/jlib.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jlib.erl b/src/jlib.erl index cb70c5a4a..1d5648a2b 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -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])). -- 2.40.0