Safe coding practices (was Re: Bug in users command)

Norman Diamond diamond at jit345.swstokyo.dec.com
Thu Jan 24 17:07:07 AEST 1991


In article <22855 at well.sf.ca.us> Jef Poskanzer <jef at well.sf.ca.us> writes:

>    #define MAXNAMES 1000
>    static char users[MAXNAMES][UT_NAMESIZE+1];
>    (void) strncpy( users[nusers], u.ut_name, UT_NAMESIZE );
>    users[nusers][UT_NAMESIZE] = '\0';
>And yes, this will fail if more than 1000 users are logged in at
>the same time.  Imagine how concerned I am.

Uh, maybe equally concerned as people who knew that their operating system
would never last 10 years, or 28 years, or whatever?
Equally concerned as people who knew that the spacecraft would not last a
year, or when it did, they knew it wouldn't last another 4 years?
You should know to set a better example than this.

Followups (if any are necessary) are directed to comp.lang.c.
--
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