diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-02-26 11:36:56 +0300 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-02-26 11:36:56 +0300 |
commit | b2095ebcfe82cdbd735909f9d472173eba4836e7 (patch) | |
tree | 1074586d4031417bc5ea131e03ba57cc405dad70 | |
parent | 0a67cdfb162364008045a2cbe820e80be148c39e (diff) |
Simplify code for splitting auth string in cyrsasl
This may fix problem from issue #2296
-rw-r--r-- | src/cyrsasl_plain.erl | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/cyrsasl_plain.erl b/src/cyrsasl_plain.erl index ec52b00a8..3bdcf8476 100644 --- a/src/cyrsasl_plain.erl +++ b/src/cyrsasl_plain.erl @@ -81,15 +81,8 @@ prepare(ClientIn) -> _ -> error end. -parse(S) -> parse1(binary_to_list(S), "", []). - -parse1([0 | Cs], S, T) -> - parse1(Cs, "", [list_to_binary(lists:reverse(S)) | T]); -parse1([C | Cs], S, T) -> parse1(Cs, [C | S], T); -%parse1([], [], T) -> -% lists:reverse(T); -parse1([], S, T) -> - lists:reverse([list_to_binary(lists:reverse(S)) | T]). +parse(S) -> + binary:split(S, <<0>>, [global]). parse_domain(S) -> parse_domain1(binary_to_list(S), "", []). |