Sujet : Re: avoiding strdup() De : bluemanedhawk (at) *nospam* invalid.invalid (Blue-Maned_Hawk) Groupes :comp.lang.c Date : 10. Mar 2024, 14:38:48 Autres entêtes Organisation : A noiseless patient Spider Message-ID :<pan$3ee01$922a1812$90fc3f75$bda42845@invalid.invalid> References :12345678910 User-Agent : Pan/0.154 (Izium; 517acf4)
Michael S wrote:
What strdup() can do better, for any chosen value of better, than strlen()+malloc()+memcpy() ?
It's shorter.
-- Blue-Maned_Hawk│shortens to Hawk│/blu.mɛin.dʰak/│he/him/his/himself/Mr. blue-maned_hawk.srht.site The logical conclusion of “don't repeat yourself” is to never say anything.