debuginfod: Remove always-false comparisons with LONG_MAX
Mark Wielaard
mark@klomp.org
Tue Mar 2 15:47:00 GMT 2021
Hi Timm,
On Tue, 2021-03-02 at 09:30 +0100, Timm Bäder via Elfutils-devel wrote:
> If I understand the code correctly, these comparisons exist only for
> the
> curl_off_t cases, in which case dl and cl might be greater than
> LONG_MAX. However, in case they are declares as double values, this
> cannot be the case and the comparisons are unnecessary.
I asked on irc why we are doing this and it was suspected that it is
becuase long on 32 bit can be smaller than the download size (returned
in a double)
So the suggestion was to change that to
(cl > (double) LONG_MAX ? LONG_MAX : (long) cl);
instead
Cheers,
Mark
More information about the Elfutils-devel
mailing list