Pārlūkot izejas kodu

Fix a bug with the calculation of the remaining length

If the result of the string format was longer than the remaining length,
the returned remaining length would be negative, which would make very
strange things happen.
pull/25/head
Andrew Thompson pirms 13 gadiem
vecāks
revīzija
f918156b10
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. +1
    -1
      src/lager_format.erl

+ 1
- 1
src/lager_format.erl Parādīt failu

@ -145,7 +145,7 @@ build([], Acc, MaxLen, _O) ->
build2([{C,As,F,Ad,P,Pad,Enc}|Cs], Count, MaxLen) ->
{S, Len} = control2(C, As, F, Ad, P, Pad, Enc, MaxLen div Count),
[S|build2(Cs, Count - 1, MaxLen - Len)];
[S|build2(Cs, Count - 1, MaxLen - abs(Len))];
build2([C|Cs], Count, MaxLen) ->
[C|build2(Cs, Count, MaxLen)];
build2([], _, _) -> [].

Notiek ielāde…
Atcelt
Saglabāt