This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] iconv_prog: Don't slurp whole input at once [BZ #6050]


On Mon, Aug 10, 2015 at 12:14:23AM +0200, Benjamin Herr wrote:
> To still support reporting the position of invalid sequences in the
> input, we count consumed input bytes explicitly. As overflow of that
> counter is now possible, we use saturating addition and just mention in
> the error message when (size_t) -1 has been reached.

Why not use uint64_t? Then it's reasonable to assume overflow does not
happen -- it would take something like a century to hit -- and you
don't underreport in the case of huge files that fit in off_t but not
size_t.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]