]> granicus.if.org Git - ejabberd/commitdiff
Fix for ejabbed bug #359 - now strings are formatted correctly.
authorLeif Bredgaard Honore <lbanders@acosys.dk>
Thu, 20 Nov 2014 10:21:51 +0000 (14:21 +0400)
committerLeif Bredgaard Honore <lbanders@acosys.dk>
Thu, 20 Nov 2014 10:21:51 +0000 (14:21 +0400)
src/ejabberd_xmlrpc.erl

index c3b2fdab7fdc10ec2b556f5d0590c80c0b33045a..b59001819cf079e3d3c7cd01b59316fd6031b0e2 100644 (file)
@@ -448,8 +448,8 @@ format_arg({array, Elements}, {list, ElementsDef})
 format_arg(Arg, integer) when is_integer(Arg) -> Arg;
 format_arg(Arg, binary) when is_list(Arg) -> list_to_binary(Arg);
 format_arg(Arg, binary) when is_binary(Arg) -> Arg;
-format_arg(Arg, string) when is_list(Arg) -> list_to_binary(Arg);
-format_arg(Arg, string) when is_binary(Arg) -> Arg;
+format_arg(Arg, string) when is_list(Arg) -> Arg;
+format_arg(Arg, string) when is_binary(Arg) -> binary_to_list(Arg);
 format_arg(Arg, Format) ->
     ?ERROR_MSG("don't know how to format Arg ~p for format ~p", [Arg, Format]),
     throw({error_formatting_argument, Arg, Format}).