+/* $NetBSD: fortune.c,v 1.7 2009/08/12 08:04:05 dholland Exp $ */
+
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
-static char sccsid[] = "@(#)fortune.c 5.5 (Berkeley) 6/10/91";
+static char sccsid[] = "@(#)fortune.c 5.5 (Berkeley) 6/10/91";
#else
-static char rcsid[] = "$NetBSD: fortune.c,v 1.3 1995/03/23 08:33:23 cgd Exp $";
+__RCSID("$NetBSD: fortune.c,v 1.7 2009/08/12 08:04:05 dholland Exp $");
#endif
-#endif /* not lint */
+#endif /* not lint */
+
+#include <stdlib.h>
+#include "header.h"
+#include "extern.h"
/* fortune.c Larn is copyrighted 1986 by Noah Morgan. */
/*
* function to return a random fortune from the fortune file
*/
-char *flines[] = {
+static const char *flines[] = {
"gem value = gem * 2 ^ perfection",
"sitting down can have unexpected results",
"don't pry into the affairs of others",
#define NFORTUNES 34
-char *
-fortune()
+const char *
+fortune(void)
{
return (flines[random() % NFORTUNES]);
}