Path: utzoo!attcan!uunet!cs.utexas.edu!usc!orion.cf.uci.edu!uci-ics!zardoz!tgate!ka3ovk!drilex!axiom!linus!chance!ccel
From: ccel@chance.uucp (CCEL)
Newsgroups: comp.unix.questions
Subject: Re: Password checking program
Message-ID: <63218@linus.UUCP>
Date: 10 Aug 89 16:10:48 GMT
Sender: news@linus.UUCP
Reply-To: rtidd@mitre.arpa
Organization: MITRE-McLean Software Engineering Laboratory
Lines: 38

In article <15257@duke.cs.duke.edu> ndd@macbeth.UUCP (Ned D. Danieley) writes:
>In article <20557@adm.BRL.MIL> rbj@dsys.ncsl.nist.gov (Root Boy Jim) writes:
>>? From: CCEL 
>>
>>? I'm still getting requests for that silly password checking program
>>? I talked about last week, and I thought i'd posted the source here
>>
>>How about a more portable and safe version? Comments follow.

As I (probably) said, I didn't write the code, I just borrowed it from
my roommate because there was so much interest in it.  I should have gone
through it to check the portability and syntax of it, but I didn't.


>Another problem is:
>...
>>? #define ENDOFFILE -1
>...
>>?               done=ENDOFFILE;
>
>some compilers will interpret this as the old =- assignment
>operator. this is one place where style can really make a difference:
>
>	done = ENDOFFILE;
>
>is easier to read and doesn't piss off cc.

You could just do

#define ENDOFFILE (-1)

and that should make everybody happy ... I got into the habit of throwing
around parenthesis a lot on #defines (especially in macros), they can't
hurt and certainly make the code more durable.

Randy Tidd                   MITRE-McLean CCEL Lab
rtidd@mitre.arpa             ccel%community-chest@gateway.mitre.org
#define DISCLAIM TRUE