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>
next in thread | previous in thread | raw e-mail | index | archive | help
--ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > >=20 > > 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 asynchronou= sly > > fixed it, but you had: > >=20 > > if(!strcmp(MAGIC, header)) > > err(1, "Expecting '%s', read '%s'", MAGIC, header); > >=20 > > but I belive you meant: > >=20 > > if(strcmp(MAGIC, header)) > > err(1, "Expecting '%s', read '%s'", MAGIC, header); > >=20 > > otherwise, the SCRSHOT_ header is read successfully but we bail incorre= ctly: >=20 > Eh? strcmp() returns 0 if the strings match, so you have to invert the > test (or, better still, write "if(strcmp(MAGIC, header) =3D=3D 0)" which I > should have done). Correct, but you wrote "if the header is correct, bail". This should probably be: if(strcmp(MAGIC, header) !=3D 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 --=20 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 --ctP54qlpMx3WjD+/ Content-Type: application/pgp-signature Content-Disposition: inline -----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----- --ctP54qlpMx3WjD+/-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010518172949.C14656>