tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch cat(1) improve -B

Me wrote:
> cat(1) says:
> -B bsize
> Read with a buffer size of bsize bytes, instead of the default
> buffer size which is the blocksize of the output file.
> I'm attaching a small patch:
> - documenting -B0 as back-ward compatible behavior,
> - handling invalid number parameter.

The original patch contained a subtle bug.
It was reusing strtoi(3), there is place for strtou(3).
As SIZE_MAX might be equal to UINTMAX_MAX and then
SIZE_MAX > INTMAX_MAX and it overflows.


Home | Main Index | Thread Index | Old Index