Xref: utzoo comp.bugs.4bsd:1662 comp.std.c:4175 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond From: diamond@jit345.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.bugs.4bsd,comp.std.c Subject: Re: Bug in users command Message-ID: <1991Jan24.021927.19310@tkou02.enet.dec.com> Date: 24 Jan 91 02:19:27 GMT References: <18969@rpp386.cactus.org> <6182:Jan2222:06:3991@kramden.acf.nyu.edu> <18981@rpp386.cactus.org> <12360:Jan2320:15:5291@kramden.acf.nyu.edu> Sender: news@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 12 In article <12360:Jan2320:15:5291@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >The correct call is strncmp(&((*a)[0]),&((*b)[0]),sizeof *a)---or, >equivalently, strncmp(*a,*b,sizeof *a). >Chris or Doug or Karl or somebody out there, could you check me on this? Mr. Bernstein appears to be right. When *a is an array, and it is not the operand of sizeof or unary &, so it has to be converted to a pointer to the first element of *a. This is true in both of Mr. Bernstein's suggested calls. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it.