Pádraig Brady <[email protected]> writes:
> On 27/09/2025 22:52, Collin Funk wrote:
>> This patch cleans up some manual overflow checks to use stdckdint.h.
>> There are some others I noticed that could be cleaned up, but they
>> require some reorganization. So I will hold off on them.
>
> I was wondering about UID and GID, but the patch looks good
> as the existing code was checking against UID_T_MAX, not UID_MAX.
Yep, it is a mostly trivial change. But I prefer using:
if (ckd_add (&uid, imaxval, 0))
error (...);
over:
if (UID_T_MAX < imaxval)
error (...);
else
uid = imaxval;
Since it is easier to make typos when comparing, e.g. using <= instead
of <.
It also trims some lines of code while not sacrificing readability which
is nice.
Collin