Password checking program

CCEL ccel at chance.uucp
Fri Aug 11 02:10:48 AEST 1989


In article <15257 at duke.cs.duke.edu> ndd at macbeth.UUCP (Ned D. Danieley) writes:
>In article <20557 at adm.BRL.MIL> rbj at dsys.ncsl.nist.gov (Root Boy Jim) writes:
>>? From: CCEL <ccel at community-chest.uucp>
>>
>>? 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 at mitre.arpa             ccel%community-chest at gateway.mitre.org
#define DISCLAIM TRUE



More information about the Comp.unix.questions mailing list