-/* $NetBSD: dm.c,v 1.22 2005/07/02 08:35:29 jmc Exp $ */
+/* $NetBSD: dm.c,v 1.25 2008/07/13 20:07:48 dholland Exp $ */
/*
* Copyright (c) 1987, 1993
#if 0
static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dm.c,v 1.22 2005/07/02 08:35:29 jmc Exp $");
+__RCSID("$NetBSD: dm.c,v 1.25 2008/07/13 20:07:48 dholland Exp $");
#endif
#endif /* not lint */
const char *hour(int);
double load(void);
void nogamefile(void);
-void play(char **) __attribute__((__noreturn__));
+void play(char **) __dead;
void read_config(void);
int users(void);
int
-main(int argc __attribute__((__unused__)), char *argv[])
+main(int argc __unused, char *argv[])
{
char *cp;
while (fgets(lbuf, sizeof(lbuf), cfp))
switch (*lbuf) {
case 'b': /* badtty */
- if (sscanf(lbuf, "%s%s", f1, f2) != 2 ||
+ if (sscanf(lbuf, "%39s%39s", f1, f2) != 2 ||
strcasecmp(f1, "badtty"))
break;
c_tty(f2);
break;
case 'g': /* game */
- if (sscanf(lbuf, "%s%s%s%s%s",
+ if (sscanf(lbuf, "%39s%39s%39s%39s%39s",
f1, f2, f3, f4, f5) != 5 || strcasecmp(f1, "game"))
break;
c_game(f2, f3, f4, f5);
break;
case 't': /* time */
- if (sscanf(lbuf, "%s%s%s%s", f1, f2, f3, f4) != 4 ||
+ if (sscanf(lbuf, "%39s%39s%39s%39s", f1, f2, f3, f4) != 4 ||
strcasecmp(f1, "time"))
break;
c_day(f2, f3, f4);
int
users(void)
{
- static struct utmpentry *ohead = NULL;
struct utmpentry *ep;
int nusers;
nusers = getutentries(NULL, &ep);
- if (ep != ohead) {
- freeutentries(ep);
- ohead = ep;
- }
return nusers;
}