diff options
author | christos <christos@NetBSD.org> | 2001-02-05 00:57:32 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2001-02-05 00:57:32 +0000 |
commit | b1c8e14afd5a078ca925fe471733a693ca4a8076 (patch) | |
tree | 479753089c657c4900becbda1592945edbc418bb /larn/moreobj.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/moreobj.c')
-rw-r--r-- | larn/moreobj.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/larn/moreobj.c b/larn/moreobj.c index 7c6766f7..f2fe8bcb 100644 --- a/larn/moreobj.c +++ b/larn/moreobj.c @@ -1,4 +1,4 @@ -/* $NetBSD: moreobj.c,v 1.4 1997/10/18 20:03:32 christos Exp $ */ +/* $NetBSD: moreobj.c,v 1.5 2001/02/05 00:57:34 christos Exp $ */ /* * moreobj.c Larn is copyrighted 1986 by Noah Morgan. @@ -9,9 +9,8 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: moreobj.c,v 1.4 1997/10/18 20:03:32 christos Exp $"); +__RCSID("$NetBSD: moreobj.c,v 1.5 2001/02/05 00:57:34 christos Exp $"); #endif /* not lint */ -#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "header.h" @@ -36,11 +35,11 @@ oaltar() iopts(); while (1) { while (1) - switch (getchar()) { + switch (lgetchar()) { case 'p': lprcat(" pray\nDo you (m) give money or (j) just pray? "); while (1) - switch (getchar()) { + switch (lgetchar()) { case 'j': if (rnd(100) < 75) lprcat("\nnothing happens"); @@ -154,7 +153,7 @@ othrone(arg) iopts(); while (1) { while (1) - switch (getchar()) { + switch (lgetchar()) { case 'p': lprcat(" pry off"); k = rnd(101); @@ -204,7 +203,7 @@ odeadthrone() iopts(); while (1) { while (1) - switch (getchar()) { + switch (lgetchar()) { case 's': lprcat(" sit down"); k = rnd(101); @@ -239,7 +238,7 @@ ochest() iopts(); while (1) { while (1) - switch (getchar()) { + switch (lgetchar()) { case 'o': lprcat(" open it"); k = rnd(101); @@ -308,7 +307,7 @@ ofountain() lprcat("\nDo you (d) drink, (w) wash yourself"); iopts(); while (1) - switch (getchar()) { + switch (lgetchar()) { case 'd': lprcat("drink"); if (rnd(1501) < 2) { |