🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #239

Re: Bug in users command

#239
From: Norman Diamond
Date: Thu, 24 Jan 1991 02:19
12 lines
1382 bytes
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.
Technical Details
Message-ID: <1991Jan24.021927.19310@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!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
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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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