Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!bloom-beacon!eru!kth.se!sunic!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!rhialto From: rhialto@cs.kun.nl (Olaf'Rhialto'Seibert) Newsgroups: comp.sys.amiga.programmer Subject: Re: Compiler code (was a flame fest) Message-ID: <2923@wn1.sci.kun.nl> Date: 5 Apr 91 15:28:14 GMT References: <1991Apr2.100807.13471@ux1.cso.uiuc.edu> <1991Apr3.042457.3703@mintaka.lcs.mit.edu> Sender: root@sci.kun.nl Organization: University of Nijmegen, The Netherlands Lines: 17 In article <1991Apr3.042457.3703@mintaka.lcs.mit.edu> someone writes: >>CopyString(s,d) >>char *s,*d; >>{ >> while(*s) { *d++=*s++; } >>} Note that this function has an incorrect name. In C, a string is 0-terminated. This does not copy the 0, so the copy is not a string. This bug was already present in the very first program that started this discussion, and I doubt the author was aware of this subtle but dangerous bug. -- Olaf 'Rhialto' Seibert rhialto@cs.kun.nl How can you be so stupid if you're identical to me? -Robert Silverberg