diff options
author | Anders Svensson <[email protected]> | 2011-09-27 11:41:19 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2011-09-27 11:41:19 +0200 |
commit | 13818bed4aa87c94546ae567750df912ba960623 (patch) | |
tree | 84d197fc540edc477d34c825a12365ff43a1f7a6 /lib/diameter | |
parent | d54c121d333f3eef9cd3b6364c54b0a1e5f2d1b0 (diff) | |
parent | 73f89318887d473536350b1531cad27f9ab94c7c (diff) | |
download | otp-13818bed4aa87c94546ae567750df912ba960623.tar.gz otp-13818bed4aa87c94546ae567750df912ba960623.tar.bz2 otp-13818bed4aa87c94546ae567750df912ba960623.zip |
Merge branch 'anders/diameter/header_folding_error/OTP-9577' into dev
* anders/diameter/header_folding_error/OTP-9577:
Fix header folding bug
Diffstat (limited to 'lib/diameter')
-rw-r--r-- | lib/diameter/src/app/diameter_lib.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/diameter/src/app/diameter_lib.erl b/lib/diameter/src/app/diameter_lib.erl index b5c0e1bf6a..46fd87c591 100644 --- a/lib/diameter/src/app/diameter_lib.erl +++ b/lib/diameter/src/app/diameter_lib.erl @@ -255,12 +255,13 @@ w(L) -> fold_tuple(_, T, undefined) -> T; -fold_tuple(N, T0, T) -> - element(2, lists:foldl(fun(X, {M,_} = A) -> {M+1, ft(X, A)} end, - {N, T0}, - lists:nthtail(N-1, tuple_to_list(T)))). +fold_tuple(N, T0, T1) -> + {_, T} = lists:foldl(fun(V, {I,_} = IT) -> {I+1, ft(V, IT)} end, + {N, T0}, + lists:nthtail(N-1, tuple_to_list(T1))), + T. -ft(undefined, T) -> +ft(undefined, {_, T}) -> T; -ft(X, {N, T}) -> - setelement(N, T, X). +ft(Value, {Idx, T}) -> + setelement(Idx, T, Value). |