Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c,comp.programming,comp.sys.raspberry-pi Subject: Re: C is not a low level language Date: Sun, 24 Feb 2019 12:55:12 -0800 Organization: None to speak of Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="d0da4294d431f134195cc12f06010206"; logging-data="22487"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GrGOuwiL/6QEJhU4LmF/v" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Gnpv6aqxQDXBBTHoXDxJl3SefGs= sha1:kGaYsoYPuRHzllmbJx4cBiBLKjg= Xref: csiph.com comp.lang.c:141251 comp.programming:9666 comp.sys.raspberry-pi:19697 "R.Wieser" writes: > (too many newsgroups, had to snip a few) > > Richard, > >> Indeed, although I'd cache the length rather than make the compiler find > > :-) And thats exactly the kind of thing you should try to avoid. > > In this simple example it will work, but you're /still/ trying to write a > full buffers worth - when you should leave that last character untouched, > just in case. "Just in case" what, exactly? Are you trying to guard against an off-by-one error but not worry about an off-by-two error? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */