ssh-keygen opens NULL filename

Martin MOKREJŠ mmokrejs at natur.cuni.cz
Thu Oct 17 06:05:40 EST 2002


On Wed, 16 Oct 2002, Tim Rice wrote:

> On Wed, 16 Oct 2002, [iso-8859-2] Martin MOKREJŠ wrote:
>
> > Hi,
> >   I did few checks and as I'm not C proghrammer at all, have just few
> > points regarding ssh-keygen.c:
> >
> > 905             if (strstr(identity_file, dotsshdir) != NULL &&
> >
> > 	isn't the above line missing a closing bracket?
>
> The closing bracket is on the next line
>         if (strstr(identity_file, dotsshdir) != NULL &&
>             stat(dotsshdir, &st) < 0) {
>                                     ^-- here it is.

Ah, fine, I was just fooled by thge gdb output. ;(


>
> >
> > 956                     snprintf(comment, sizeof comment, "%s@%s", pw->pw_name, hostname);
> >
> > -----------------------------------------------^ sizeof(comment) instead?
>
> Acording to "C A Reference Manual" third edition,
> 	sizeof-expression:
> 		sizeof ( type-name )
> 		sizeof unary-expression
> The sizeof expression has two forms: the operator sizeof followed by a
> parenthesized type name, or the operator sizeof followed by an
> operand expression.
>
> The compiler is probably able to figure it out.
> Seems like we would want to be consistant though.
> It looks like there are 772 other lines spread through 33 files that
> use sizeof without parens.

Well, I did not say it doesn't work. If you think it's fine, then it's
fine. I'm really not a programmer.
Thanks for explanation!

-- 
Martin Mokrejs <mmokrejs at natur.cuni.cz>, <m.mokrejs at gsf.de>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585




More information about the openssh-unix-dev mailing list