Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!yale!quasi-eli!cs.yale.edu!tarr-michael From: tarr-michael@CS.YALE.EDU (michael tarr) Newsgroups: comp.sys.mac.programmer Subject: Re: Disinfectant 2.0 Sample Code Message-ID: <25571@cs.yale.edu> Date: 15 Jul 90 19:03:19 GMT References: <9510@accuvax.nwu.edu> <40562@think.Think.COM> Sender: news@cs.yale.edu Reply-To: tarr-michael@CS.YALE.EDU (michael tarr) Organization: Department of Psychology, Yale University Lines: 17 Think C 4.01 also has a bug in strncpy: char s1[10]; char s2[20] = "A long string"; strncpy(s1, s2, 8); s1 will not have a '\0' appended to the end. So far as I can tell this is not per the standard definition. Also sizeof returns an int, but malloc and calloc require size_t! This is hidden on a none highlighted single line of text... Caused me great pain to find this... Mike Tarr tarr@cs.yale.edu