From f9a61af2dc0c66f58baab3540090efd9a26e5615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 24 May 2010 13:49:00 +0200 Subject: [PATCH] Don't need a + in replace regexpes since they're global. --- src/egs_game.erl | 2 +- src/egs_proto.erl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/egs_game.erl b/src/egs_game.erl index 4db460f..2c88ba0 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -394,7 +394,7 @@ handle(16#0304, _, GID, Version, Packet) -> end, [LogName|_] = re:split(ActualName, "\\0\\0", [{return, binary}]), [LogMessage|_] = re:split(ChatMessage, "\\0\\0", [{return, binary}]), - log(GID, io_lib:format("chat from ~s: ~s", [[re:replace(LogName, "\\0+", "", [global, {return, binary}])], [re:replace(LogMessage, "\\0+", "", [global, {return, binary}])]])), + log(GID, io_lib:format("chat from ~s: ~s", [[re:replace(LogName, "\\0", "", [global, {return, binary}])], [re:replace(LogMessage, "\\0", "", [global, {return, binary}])]])), lists:foreach(fun(User) -> User#users.pid ! {psu_chat, GID, ActualName, ChatModifiers, ChatMessage} end, egs_db:users_select_all()); %% @doc Map change handler. diff --git a/src/egs_proto.erl b/src/egs_proto.erl index 8da6363..65826d4 100644 --- a/src/egs_proto.erl +++ b/src/egs_proto.erl @@ -123,8 +123,8 @@ packet_split(Packet, Result) -> parse_auth_request(Packet) -> << _:352, Username:192/bits, Password:192/bits, _/bits >> = Packet, - [{username, re:replace(Username, "\\0+", "", [global, {return, binary}])}, - {password, re:replace(Password, "\\0+", "", [global, {return, binary}])}]. + [{username, re:replace(Username, "\\0", "", [global, {return, binary}])}, + {password, re:replace(Password, "\\0", "", [global, {return, binary}])}]. %% @doc Parse a character creation command. Return the character number and data.