save less

2015-11-06 Thread Ted Unangst
less has a peculiar estrdup function. unlike ecalloc etc., it only prints an error but doesn't quit. But the callers don't seem to check for null. And in many places they call a function called save() instead. It is clearer to make estrdup() quit and use it everywhere. Index: cmdbuf.c

Re: save less

2015-11-06 Thread Theo de Raadt
>On Sat, Nov 07, 2015 at 12:12:55AM -0500, Michael McConville wrote: >> Ted Unangst wrote: >> > less has a peculiar estrdup function. unlike ecalloc etc., it only >> > prints an error but doesn't quit. But the callers don't seem to check >> > for null. And in many places they call a function

Re: save less

2015-11-06 Thread Nicholas Marriott
Hmm I thought this was deliberate but looking at where estrdup is used it is obviously not. ok nicm On Fri, Nov 06, 2015 at 11:07:26PM -0500, Ted Unangst wrote: > less has a peculiar estrdup function. unlike ecalloc etc., it only prints an > error but doesn't quit. But the callers don't seem

Re: save less

2015-11-06 Thread Nicholas Marriott
On Sat, Nov 07, 2015 at 12:12:55AM -0500, Michael McConville wrote: > Ted Unangst wrote: > > less has a peculiar estrdup function. unlike ecalloc etc., it only > > prints an error but doesn't quit. But the callers don't seem to check > > for null. And in many places they call a function called

Re: save less

2015-11-06 Thread Michael McConville
Ted Unangst wrote: > less has a peculiar estrdup function. unlike ecalloc etc., it only > prints an error but doesn't quit. But the callers don't seem to check > for null. And in many places they call a function called save() > instead. > > It is clearer to make estrdup() quit and use it