From: Stuart Henderson Subject: Re: Fix for vi editing mode in sftp(1) (PING) To: Christian Schulte Cc: Crystal Kolipe , tech@openbsd.org Date: Tue, 20 Jan 2026 09:40:49 +0000 On 2026/01/20 04:10, Christian Schulte wrote: > Am 20.01.2026 um 00:44 schrieb Crystal Kolipe: > > > > So what Stuart suggested, whilst technically not absolutely necessary, is good > > programming practice. > > > > The manual should be the only source to decide things like this and this > only says: > > el_set() ... Returns 0 on success, -1 on failure. > el_get() ... Returns 0 if successful, -1 otherwise. > > The return value of el_set is not checked either. I did not take a If the existing unchecked el_set() calls fail it's not a big problem and there isn't really anything sftp(1) can do differently. If el_get() fails you can't assume anything about the contents of the pointer so it's not safe to use it. (Also remember that this code will run with editline implementations other than OpenBSD's so being a bit careful with this is appropriate). Note the return value of el_get() *is* checked in Complete() in sftp.c.