Path: utzoo!attcan!uunet!ateng!chip From: chip@ateng.ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: hardcoded constants Message-ID: <1988Dec21.133910.23182@ateng.ateng.com> Date: 21 Dec 88 18:39:10 GMT References: <1988Dec8.173158.11839@utzoo.uucp> <846@starfish.Convergent.COM> <9134@smoke.BRL.MIL> <1988Dec13.172306.16195@utzoo.uucp> <5146@bsu-cs.UUCP> <1988Dec15.190331.2986@utzoo.uucp> Organization: A T Engineering, Tampa, FL Lines: 16 According to henry@utzoo.uucp (Henry Spencer): >Trouble is, often it's almost impossible to devise a meaningful name. >I'm not talking about hard-coding things like choice of control characters, >but about things like (in a function to concatenate two strings with a >'/' in between): > > foo = malloc(strlen(a)+strlen(b)+2); /* 2 for '/' '\0' */ Not hard: foo = malloc(strlen(a)+sizeof("/")+strlen(b)); -- Chip Salzenberg or A T Engineering Me? Speak for my company? Surely you jest! "It's no good. They're tapping the lines."