bug#14530: [PATCH] od: -wN, N>64K, avoid misbehavior on systems with 32-
From:
Pádraig Brady
Subject:
bug#14530: [PATCH] od: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t
Date:
Sun, 02 Jun 2013 16:16:04 +0100
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 06/02/2013 03:39 AM, Jim Meyering wrote:
> Rich reported this bug privately.
>
> Here's a proposed patch.
> I could have fixed the underlying problem with
> explicit casts to a wider type (including floating point types),
> but this seemed cleanest, if perhaps a little too subtle.
> I'd rather not write a comment in each of three places,
> and didn't really want to factor out a 3-input function
> just to compute each next_pad value.
Since this is just a local variable,
I think the proposed solution is fine.
> Along the way, I noticed that an unreasonably large width
> caused trouble, but I'm not inclined to worry about it:
>
> $ : | od -An -a -w$(echo 2^32-1|bc)
> od: memory exhausted
Yes this is an artificial limit, but in such
and edge case as I don't think it's worth
complicating the code for.
+1
thanks,
Pádraig.