Fix pkt-line length

This commit is contained in:
Carlos Martín Nieto
2013-05-27 02:50:45 +02:00
parent dacbbbc20e
commit 23baf9a8b0

View File

@@ -4,5 +4,7 @@
-spec line(iolist()) -> iolist().
line(Text) ->
Prefix = io_lib:format("~4.16.0b", [iolist_size(Text) + 1]),
% prefix's own size + text size + LF
Len = 4 + iolist_size(Text) + 1,
Prefix = io_lib:format("~4.16.0b", [Len]),
[Prefix, Text, "\n"].