Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <5.0.0.25.0.20001207184228.029cc040@pop.bresnanlink.net> X-Sender: cabbey AT pop DOT bresnanlink DOT net X-Mailer: QUALCOMM Windows Eudora Version 5.0 Date: Thu, 07 Dec 2000 18:53:58 -0600 To: cygwin AT cygwin DOT com From: Chris Abbey Subject: Re: [patch] default homedir (was: Re: Problem withssh-keygen.exe. In-Reply-To: <00120716461402.03851@cobold> References: <5 DOT 0 DOT 0 DOT 25 DOT 0 DOT 20001207090607 DOT 028cc290 AT pop DOT bresnanlink DOT net> <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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed At 16:46 12/7/00 +0100, Corinna Vinschen wrote: >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... bah, ok I see it now, I was looking at the strcpy as the problem you were pointing to and thinking "but strcpy doesn't care what's in the destination already, it overwrites it"... forgetting totally the strlen call before that. I've been thinking in java too much..... :) >A problem of confirmed habits... and I'm definitely not free of >them. guilty as charged as well... I don't think there's anyone who isn't. in a seperate fork Earnie Boyd wrote: >I don't find this "sloppy code" at all. In fact I would automatically do it >this way as it is faster to do bit boolean than byte/word comparison. GCC >optimizations probably make it a mute point but I've been around for a long >time and not all compilers are as good. like I said, in *my* opinion.... I'm an OO person and to *me* a Boolean and an Integer are NOT interchangeable... I like strongly typed languages and compilers that complain... we'll ok, I do *now* a few years ago I didn't, and would in fact have done exactly what you do for much the same reason. Too much time with the "applications" people has warped my brain to a different way of thinking. It all boils down to personal preferences and the task at hand. If we were talking about embedded code that had to perform in realtime then I'd balk at us working in a language as high as C or C++, and that exact type of thinking is what I'd be looking for in asm code, but we're not. now the forces of openness have a powerful and unexpected new ally http://ibm.com/linux/ -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com