GNU bug report logs - #14530
[PATCH] od: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 2 Jun 2013 02:42:01 UTC

Severity: normal

Tags: fixed, patch

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 14530 <at> debbugs.gnu.org, Rich Burridge <rich.burridge <at> oracle.com>
Subject: bug#14530: [PATCH] od: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t
Date: Sun, 02 Jun 2013 18:31:54 +0200
close 14530
thanks

Pádraig Brady wrote:

> 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 for the review.
Pushed.




This bug report was last modified 6 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.