delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/07/10:47:45

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Corinna Vinschen <cygwin AT cygwin DOT com>
Date: Thu, 7 Dec 2000 16:46:14 +0100
X-Mailer: KMail [version 1.1.99]
To: cygwin AT cygwin DOT com
References: <Pine DOT SOL DOT 3 DOT 91 DOT 1001205145615 DOT 26082A-100000 AT cse DOT cygnus DOT com> <5 DOT 0 DOT 0 DOT 25 DOT 0 DOT 20001206202732 DOT 02a2f640 AT pop DOT bresnanlink DOT net> <5 DOT 0 DOT 0 DOT 25 DOT 0 DOT 20001207090607 DOT 028cc290 AT pop DOT bresnanlink DOT net>
In-Reply-To: <5.0.0.25.0.20001207090607.028cc290@pop.bresnanlink.net>
Subject: Re: [patch] default homedir (was: Re: Problem withssh-keygen.exe.
MIME-Version: 1.0
Message-Id: <00120716461402.03851@cobold>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id KAA31308

On Thursday 07 December 2000 16:15, Chris Abbey wrote:
> >- You have used `passed_home_path' uninitialized which resulted in
> >   garbage in the output on my system when the `-p' option wasn't
> >   given.
>
> that was at line 393, the original strcpy, right? I thought
> strcpy would effectively initialize it for us?

I'm not quite sure what line you're referring to. The code was
like that:

	char x[100];

	...
	if (strlen(x) == 0)
	  strcpy(x, "foo");

So, if the option -p wasn't given, your code relied on the
illegal assumption that the data space of an automatic var
is filled with 0 bytes. The result was that `passed_home_path'
was uninitialized when `-p' wasn't given and the strlen
returned 0 only in 1 of 256 cases...

>
> >- We are following the GNU coding convention in that a space should be
>
> opps, another habit, again mental note made for future patches...
> this particular file isn't exactly the model of consistent
> formatting though, is it?

Nope. The problem is that the file isn't consistantly maintained
by people with the same style. This is a general problem in OS
projects. Sometimes a patch is checked in without care for the
style, sometimes it's forced by a maintainer, sometimes the
maintainer uses it's own style ignoring the coding standard.
A problem of confirmed habits... and I'm definitely not free of
them.

> no problem, I was part of the affected group, as were
> people I know... don't ya just love open source. :)

Yep.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
mailto:vinschen AT redhat DOT com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019