Path: utzoo!attcan!uunet!samsung!xylogics!merk!alliant!linus!think!ephraim From: ephraim@think.com (Ephraim Vishniac) Newsgroups: comp.sys.mac.programmer Subject: Re: Disinfectant 2.0 Sample Code Message-ID: <40722@think.Think.COM> Date: 17 Jul 90 13:55:29 GMT References: <9510@accuvax.nwu.edu> <40562@think.Think.COM> <25571@cs.yale.edu> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 22 In article <25571@cs.yale.edu> tarr-michael@CS.YALE.EDU (michael tarr) writes: >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. So far as I can tell, this is perfectly standard. I'm looking at the man pages for strncpy from Ultrix (DEC Unix for VAX) and Sun OS 4.0 and both warn that strncpy can produce unterminated strings. Sorry, I don't have the Think C libraries manual here, but I'd be amazed if it says anything different. -- Ephraim Vishniac ephraim@think.com ThinkingCorp@applelink.apple.com Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142 One of the flaws in the anarchic bopper society was the ease with which such crazed rumors could spread.