diff options
author | 2001-02-05 00:57:32 +0000 | |
---|---|---|
committer | 2001-02-05 00:57:32 +0000 | |
commit | b1c8e14afd5a078ca925fe471733a693ca4a8076 (patch) | |
tree | 479753089c657c4900becbda1592945edbc418bb /larn/signal.c | |
parent | 5813ff28d2110a139386e10f5e3977f3b88dbda8 (diff) | |
download | bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.tar.gz bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.tar.zst bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.zip |
- rename getchar to lgetchar to avoid conflicts with the stdio getchar
- fix redundant decls and nested externs
- use snprintf instead of sprintf
Diffstat (limited to 'larn/signal.c')
-rw-r--r-- | larn/signal.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/larn/signal.c b/larn/signal.c index e16ff8ee..2b08a052 100644 --- a/larn/signal.c +++ b/larn/signal.c @@ -1,14 +1,14 @@ -/* $NetBSD: signal.c,v 1.6 1997/10/18 20:03:50 christos Exp $ */ +/* $NetBSD: signal.c,v 1.7 2001/02/05 00:57:34 christos Exp $ */ /* "Larn is copyrighted 1986 by Noah Morgan.\n" */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: signal.c,v 1.6 1997/10/18 20:03:50 christos Exp $"); +__RCSID("$NetBSD: signal.c,v 1.7 2001/02/05 00:57:34 christos Exp $"); #endif /* not lint */ -#include <stdio.h> #include <signal.h> +#include <stdio.h> #include <string.h> #include <unistd.h> #include "header.h" @@ -131,7 +131,9 @@ sigpanic(sig) { char buf[128]; signal(sig, SIG_DFL); - sprintf(buf, "\nLarn - Panic! Signal %d received [SIG%s]", sig, sys_signame[sig]); + snprintf(buf, sizeof(buf), + "\nLarn - Panic! Signal %d received [SIG%s]", sig, + sys_signame[sig]); write(2, buf, strlen(buf)); sleep(2); sncbr(); |