rgrinberg / bencode

Bencode (.torrent file format) reader/writer in OCaml
24 stars 4 forks source link

Bencode_streaming.Encode fails on min_int #4

Closed stedolan closed 7 years ago

stedolan commented 7 years ago
# Bencode_streaming.Encode.to_string (Bencode.Integer min_int);;
Exception: Invalid_argument "String.blit / Bytes.blit_string".

(seems to be just Bencode_streaming, Bencode.encode_to_string works fine)

c-cube commented 7 years ago

Interesting. Because - min_int is min_int, the log10 of - min_int is negative and leads to a wrong estimation of the length it will take once displayed.