Commit Graph

86 Commits

Author SHA1 Message Date
dholland 591ca18c53 Split some code from moreobj.c into action.c, as per larn 12.2. 2008-02-19 06:05:26 +00:00
dholland f5334b0815 More assorted cleanup merged from larn 12.2. 2008-02-04 01:07:01 +00:00
dholland c310e89d2d Once upon a time, larn 12.0 had functions named getchar() and putchar()
that conflicted with libc. We changed them to lgetchar() and xputchar()
respectively; larn 12.2 changed them to ttgetch() and ttputch(). After
reflecting on this for a while I've decided to adopt the larn 12.2
names; not so much for compatibility but for consistency going forward.
So, massrename them. Also make ttputch() static.
2008-02-03 21:24:58 +00:00
dholland e87aa9031c Don't create files mode 666 in /var. (The code in question is not enabled
by default, though.)
2008-02-03 20:41:53 +00:00
dholland 5c10491064 Larn does not need its own private versions of functions from <ctype.h>.
Also, remove the function gettokstr(), which is not used. From larn 12.2.
2008-02-03 20:11:04 +00:00
dholland b6e0b3d3c9 A long time ago, larn had code to prohibit playing it during work hours.
Most of this code was removed ages ago, probably when dm(6) was invented;
long before -r1.1 in the NetBSD tree in any event.

Now remove the last fragment of it.

Also nuke the file of US holidays 1987-1993 that we've been carrying
around for no reason.
2008-02-03 20:01:24 +00:00
dholland ef066a156b Some assorted minor cleanups, from larn 12.2. 2008-02-03 19:29:50 +00:00
dholland d7ba3de791 Make a bunch of functions static. Merged from larn 12.2. 2008-02-03 19:20:40 +00:00
dholland ded3829627 Use mkstemp to make the temporary files used when you win. 2008-02-03 03:49:15 +00:00
dholland 511d1e002c Since games are (now) setgid, not setuid, it is no longer necessary to
manipulate the effective uid, only the effective gid.
2008-02-03 03:45:55 +00:00
dholland 398690b6f4 Call srandom() as well as initializing the private random generator
(which is crappy and should be removed, but that's for another day...)
This way e.g. fortune cookies no longer appear always in the same order.
2008-01-28 05:48:57 +00:00
dholland 9cc7e27481 Larn now builds with WARNS=4. 2008-01-28 05:38:53 +00:00
dholland 3d81345939 Apparently the reason the printf arguments were all wrong is that larn
had its own private and not-quite-standard implementation of printf.
Remove it surgically with a chainsaw.
2008-01-28 04:04:17 +00:00
dholland 8ce4d17196 Add gcc printf format checking, and fix the abundant problems this revealed.
(It appears that someone sometime thought that you use %d to print a long.)
2008-01-28 03:39:30 +00:00
mouse 2609539fc5 Per PR 36185, OKed by martin@ 2007-04-22 02:09:02 +00:00
wiz 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00
mrg aadd7d4847 sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4. 2006-05-11 23:16:28 +00:00
mrg 524d5f27c4 lrint() -> larn_lrint(). 2006-05-11 10:23:24 +00:00
mrg 4bc6feceb6 end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
2006-05-11 00:22:52 +00:00
snj bf5ceaae16 It's "its." 2006-04-24 18:00:53 +00:00
christos 0e8c6c24b2 Coverity CID 2073: Fix memory leak. 2006-03-19 00:37:15 +00:00
christos 0255deb434 Coverity CID 999: Prevent NULL deref. 2006-03-19 00:32:18 +00:00
wiz d9f5a9df01 Use standard AUTHORS section header. From YOMURA Masanori in private mail
Sort sections if necessary. Use more/better markup.
2005-09-15 02:09:41 +00:00
simonb 1d351ebc53 Remove a incorrect semicolon at the end of an if().
Magic levels now appear after extensive play testing!
2005-02-25 15:04:43 +00:00
perry 1a3bb884dc A preprocessor macro named "srand" was defined which seeded the random
number generator.

Unfortunately, it conflicted with a function of the same defined in
stdlib.h. This was masked by the __P hack, which is now being purged.

I've renamed "srand" to "seedrand" to eliminate the conflict.
2005-02-03 02:23:02 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
jsm cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
agc c5275d9ccd Don't redefine NULL 2003-10-21 07:26:39 +00:00
agc e5aeb4ea46 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22269, verified by myself.
2003-08-07 09:36:50 +00:00
wiz 43fd1b176d Sy Aq -> Aq Sy so both work. 2003-07-01 10:25:03 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
wiz c91d8d6b9b Lots of minor fixes resulting from reading these man pages in detail. 2002-09-26 18:31:58 +00:00
wiz 0d22e30cd0 New sentences begin on new lines.
Patch from Richard Elz, slightly improved by yours truly.
2002-09-26 16:12:39 +00:00
wiz 7fd8f3df3f __STDC__ is always defined on NetBSD. 2002-05-26 00:12:11 +00:00
ross dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
christos 1703d1eee6 Update to the new t_agetstr() API. 2001-11-02 18:27:00 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
christos a0d324ea8d - rename getchar to lgetchar to avoid conflicts with the stdio getchar
- fix redundant decls and nested externs
- use snprintf instead of sprintf
2001-02-05 00:57:32 +00:00
lukem 51ea0cba47 remove unnecessary command name after .Nm 2000-11-07 05:51:54 +00:00
matt 3233065035 More include additions for exit, abs, strcmp, etc. 2000-07-03 03:57:39 +00:00
blymn 51164fe56a Fix coredump on start. 2000-05-24 14:20:29 +00:00
blymn 494e4c93a6 Converted games to use the new termcap interface. 2000-05-22 12:42:46 +00:00
lukem 88d3d7c59e update after change to return value of tputs() third argument 1999-10-04 23:26:59 +00:00
erh 55f3a4b91b Fix .Bl/.El imbalance. 1999-03-10 09:29:08 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
lukem b569ddabe9 don't install in /usr/share if NOSHARE is defined 1998-09-29 07:33:20 +00:00
veego 04afeca685 Add braces to make the new egcs happy. 1998-08-30 09:19:36 +00:00
mycroft a6bb9f4ef1 const poisoning. 1998-07-27 01:12:35 +00:00
mikel f160a96172 fix typo; ryker@openbsd.org 1998-02-12 08:07:49 +00:00
mrg 6074e1b476 install games that need it setgid. 1997-11-20 00:12:30 +00:00