Bug in bsd-misc.c
Mark D. Roth
roth+openssh at feep.net
Tue Mar 13 17:07:10 EST 2001
On Mon Mar 12 15:51 2001 -0600, mouring at etoh.eviladmin.org wrote:
> On Mon, 12 Mar 2001 wwieser at gmx.de wrote:
[...]
> > There is a REALLY obvious bug in bsd-misc.c, quoted below:
> >
> > #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) &&
> > defined(HAVE_SYS_NERR)
> > const char *strerror(int e)
> > {
> > extern int sys_nerr;
> > extern char *sys_errlist[];
> >
> > if ((e >= 0) || (e < sys_nerr))
> > return("unlisted error");
> > else
> > return(sys_errlist[e]);
> > }
> > #endif
> >
> > (Shouldn't the return statements be swapped?!)
>
> I believe so.
Should the "||" be changed to "&&" as well?
--
Mark D. Roth <roth at feep.net>
http://www.feep.net/~roth/
More information about the openssh-unix-dev
mailing list