Maximal length for :bytes?

Russ Allbery rra at stanford.edu
Thu Sep 4 22:03:36 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

> The buffer which contains the :bytes metadata is currently limited to 6
> digits; therefore, its value is incorrect for articles whose length
> exceed 999,999 octets.
>
> In fact, it is stocked in a char buff[16] and the buff is "Bytes: %lu\r\n".
> If :bytes is 1,234,567, the overview contains 123,456.
>
> Should we allow more?  Is buff[18] enough?  (up to about 100MB for an
> article!)

I think this would be a good place to use asprintf and dynamically
allocated memory rather than a static buffer.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list