Module Name: src
Committed By: lukem
Date: Tue Apr 28 08:32:57 UTC 2009
Modified Files:
src/usr.sbin/sa: main.c
Log Message:
Fix issue I introduced in WARNS=4 -- addition of extra argument to default argv.
Found & fixed by Geoff Wing.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sa/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sa/main.c
diff -u src/usr.sbin/sa/main.c:1.23 src/usr.sbin/sa/main.c:1.24
--- src/usr.sbin/sa/main.c:1.23 Sat Apr 18 13:37:04 2009
+++ src/usr.sbin/sa/main.c Tue Apr 28 08:32:56 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.23 2009/04/18 13:37:04 lukem Exp $ */
+/* $NetBSD: main.c,v 1.24 2009/04/28 08:32:56 lukem Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -39,7 +39,7 @@
__COPYRIGHT("@(#) Copyright (c) 1994\
Christopher G. Demetriou. All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.23 2009/04/18 13:37:04 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.24 2009/04/28 08:32:56 lukem Exp $");
#endif
/*
@@ -76,8 +76,8 @@
int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
int cutoff = 1;
-static char *dfltargv[] = { __UNCONST(_PATH_ACCT), 0 };
-static int dfltargc = (sizeof(dfltargv)/sizeof(char *));
+static const char *dfltargv[] = { _PATH_ACCT };
+static const int dfltargc = (sizeof(dfltargv)/sizeof(char *));
/* default to comparing by sum of user + system time */
cmpf_t sa_cmp = cmp_usrsys;
@@ -201,7 +201,7 @@
if (argc == 0) {
argc = dfltargc;
- argv = dfltargv;
+ argv = __UNCONST(dfltargv);
}
/* for each file specified */