Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2001 17:29:49 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Nik Clayton <nik@FreeBSD.ORG>
Cc:        John Reynolds~ <jreynold@sedona.ch.intel.com>, doc@FreeBSD.ORG
Subject:   Re: Policy on image source files in the CVS tree
Message-ID:  <20010518172949.C14656@Odin.AC.HMC.Edu>
In-Reply-To: <20010519004606.E1757@catkin.nothing-going-on.org>; from nik@FreeBSD.ORG on Sat, May 19, 2001 at 12:46:06AM %2B0100
References:  <20010517122744.B3349@catkin.nothing-going-on.org> <20010517113103.A25222@Odin.AC.HMC.Edu> <200105180028.f4I0Snn05073@bmah-freebsd-0.cisco.com> <20010518013645.A8358@catkin.nothing-going-on.org> <15109.16691.817238.944467@hip186.ch.intel.com> <20010518184813.B12846@catkin.nothing-going-on.org> <15109.25794.690992.994411@hip186.ch.intel.com> <20010518224728.C1757@catkin.nothing-going-on.org> <15109.43699.126204.944263@hip186.ch.intel.com> <20010519004606.E1757@catkin.nothing-going-on.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sat, May 19, 2001 at 12:46:06AM +0100, Nik Clayton wrote:
> On Fri, May 18, 2001 at 04:05:23PM -0700, John Reynolds~ wrote:
> > 
> > yeah--that looks good Nik! Though, I spotted one foobar in the code. I just
> > saw you created a port so I betcha you already saw this and asynchronously
> > fixed it, but you had:
> > 
> >         if(!strcmp(MAGIC, header))
> >                 err(1, "Expecting '%s', read '%s'", MAGIC, header);
> > 
> > but I belive you meant:
> > 
> >         if(strcmp(MAGIC, header))
> >                 err(1, "Expecting '%s', read '%s'", MAGIC, header);
> > 
> > otherwise, the SCRSHOT_ header is read successfully but we bail incorrectly:
> 
> Eh?  strcmp() returns 0 if the strings match, so you have to invert the
> test (or, better still, write "if(strcmp(MAGIC, header) == 0)" which I
> should have done).

Correct, but you wrote "if the header is correct, bail".  This should
probably be:

if(strcmp(MAGIC, header) != 0)
	err(1, "Expecting '%s', read '%s'", MAGIC, header);

since you're looking for failure to match and style(9) says "Don't use
'!' for tests unless it's a boolean."

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7Bb59XY6L6fI4GtQRAhJcAKDLRYLlFwphbibc/LS7CqbynopH6gCeIHXV
AY0tU0jJS2cdVwc0a3Lrkvc=
=UX35
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010518172949.C14656>