Xref: utzoo comp.sources.wanted:15366 alt.sources.wanted:952 comp.lang.c:36333 Path: utzoo!utgpu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!dkuug!iesd!iesd.auc.dk!fischer From: fischer@iesd.auc.dk (Lars P. Fischer) Newsgroups: comp.sources.wanted,alt.sources.wanted,comp.lang.c Subject: Re: What is strdup() supposed to do? Does anyone have a copy? Message-ID: Date: 20 Feb 91 18:46:12 GMT References: <1991Feb17.045913.17126@sbcs.sunysb.edu> <1991Feb17.164731.7564@onion.rain.com> <1991Feb18.154159.430@persoft.com> <1991Feb19.004526.16033@onion.rain.com> Sender: news@iesd.auc.dk Organization: Mathematics and Computer Science, University of Aalborg Lines: 23 In-reply-to: jeff@onion.rain.com's message of 19 Feb 91 00:45:26 GMT >>>>> dag@persoft.com (Daniel Glasser) writes: Daniel>Nit #2: You should simplify your expression in the "malloc()", that is, Daniel> sizeof(char) * strlen(foo) + sizeof(char) Daniel> could be written Daniel> sizeof(char) * (strlen(foo) + 1) >>>>> jeff@onion.rain.com (Jeff Beadles) then said: Jeff> Untrue. What if sizeof(char) != 1? Yours will break, and mine Jeff> will work. Gimme a break. Are you going to tell us that A * (B + 1) != A * B + A for A != 1 ?? If you can't handle basic arithmetic, what makes you think you can write a C program? /Lars -- Lars Fischer, fischer@iesd.auc.dk | Beauty is a French phonetic corruption CS Dept., Univ. of Aalborg, DENMARK. | - FZ