Path: utzoo!attcan!lsuc!sq!msb From: msb@sq.sq.com (Mark Brader) Newsgroups: comp.lang.c Subject: Re: C style guide Message-ID: <1989Dec17.110831.18119@sq.sq.com> Date: 17 Dec 89 11:08:31 GMT References: <10106@june.cs.washington.edu> Reply-To: msb@sq.com (Mark Brader) Organization: SoftQuad Inc., Toronto Lines: 46 The revised Indian Hill style guide recently posted here is excellent in many respects, but the example function copy() in section 14 contains no fewer than four bugs, of which three are in the same line. Here's a patch which I have tested and which fixes all of them. Finding them without reading the patch is left as an exercise for the reader. Patch follows: *** ihill.old Sun Dec 17 12:55:21 1989 --- ihill Sun Dec 17 12:57:38 1989 *************** *** 1478,1490 **** .\" { ! char *retval = dest; ! while (*dest++ = *++src && maxsize-- > 0) ! ; /* VOID */ ! if (maxsize == 0) ! retval = NULL; ! ! return (retval); } .Ee --- 1478,1488 ---- .\" { ! char *p = dest; ! while (maxsize-- > 0) ! if ((*p++ = *src++) == '\\\\0') ! return dest; ! return (char *) NULL; } .Ee -- Mark Brader, SoftQuad Inc., Toronto, utzoo!sq!msb, msb@sq.com "I'm a little worried about the bug-eater," she said. "We're embedded in bugs, have you noticed?" -- Niven, "The Integral Trees" This article is in the public domain.