Bug in users command
Norman Diamond
diamond at jit345.swstokyo.dec.com
Thu Jan 24 13:19:27 AEST 1991
In article <12360:Jan2320:15:5291 at kramden.acf.nyu.edu> brnstnd at 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 at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list