> Bart Blanquart wrote: > > On 02/25/09 22:09, Scott Rotondo wrote: > > > Bart Blanquart wrote: > > >> Current webrev at http://cr.opensolaris.org/~bartbl/6251549-20090225/ > > > > > > This is OK, but it would also work fine if you get rid of strdup() and > > > the corresponding free() at line 136. > > > > Yeah, but that makes things more fragile. A later call to getpw*() could > > change the username being processed. > > Since we know the only such calls in this program are in get_username(), > I would get rid of the strdup(). However, I don't feel strongly enough > to insist on this point.
I feel a lot stronger than Scott on this point. IMO, it is misleading to future maintainers. It also overly complicates the code, again misleading future maintainers. Gary..