[TUHS] reviving a bit of WWB
Steve Nickolas
usotsuki at buric.co
Mon Sep 21 06:12:34 AEST 2020
On Sun, 20 Sep 2020, Will Senn wrote:
> while((entry = getutxent()))
>
> Hardly edifying :).
>
> Much better would ve the explicit compare:
>
> while((entry = getutxent()) != NULL)
>
> But even that implies the programmer isn’t capable of differentiating = and ==.
My version of that is "while (0!=(entry=getutxevent()))".
(Of course, that assumes NULL is 0, but I don't think I've run into any
architecture so braindead as to not have NULL=0.)
-uso.
More information about the TUHS
mailing list