Bug in users command

John F Haugh II jfh at rpp386.cactus.org
Sun Jan 20 06:34:22 AEST 1991


In article <18928:Jan1916:26:3291 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>No. Unless I'm mistaken, the objects being passed in are pointers to
>arrays of char, while the objects expected are pointers to char. There
>is no implicit conversion that justifies this, though undoubtedly it
>works on most machines.

How does a pointer to an unknown number of characters differ from a
pointer to a known number of characters when passed as an argument?

qsort() invokes scmp() with the pointer to an array of UT_NAMESIZE
characters.  scmp() is expecting a pointer to a character, which is
coincidentally the same type object as "char a[UT_NAMESIZE]" since
any "array of type X" type parameters are converted to "pointer to
type X object" parameters.  I believe this is plainly specified
both by ANSI-C and K&R-Classic.

>Anyway, the 200-user limit is purely silly.

Agreed.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"While you are here, your wives and girlfriends are dating handsome American
 movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."



More information about the Comp.bugs.4bsd.ucb-fixes mailing list