From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <346284.71015.qm@web83904.mail.sp1.yahoo.com> Date: Thu, 29 Jul 2010 08:18:14 -0700 From: "Brian L. Stuart" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: <764fc0b0ab4cc1f9a890bc61a61a7c81@ladd.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] writing to ctl using fprint and write Topicbox-Message-UUID: 44cd7dd2-ead6-11e9-9d60-3106f5b1d025 > > Thanks Erik, Sape, and=0A> Skip.=A0 That was such a STUPID error, and I= thank=0A> > you all for the extra eyes.=A0 I think it is time=0A> for a br= eak and a bowl of=0A> > tea...=0A> =0A> relax.=A0 not stupid, subtle.=A0 it= takes vigilance=0A> to keep=0A> sizeof, nelem, strlen, and the number of c= haracters=0A> straight.=0A=0AThis is part of why I often recommend (and gen= erally=0Ado myself) that sizeof only be used on types, not=0Avariables:=0A= =0AFoo bar;=0A=0Ause sizeof(Foo) rather than sizeof(bar). It does=0Arequir= e slightly more work for arrays:=0A=0AFoo bar[NFOO];=0A=0Arequires NFOO * s= izeof(Foo) rather than sizeof(bar),=0Abut I personally think it's worth it = to keep the=0Adistinction between sizeof and strlen straight.=0A=0ABLS=0A