summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-25 00:20:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-25 00:20:20 +0000
commit018a2aca54170a3d4aef4b141a2f4578ec67a670 (patch)
tree29a18a093c6a7ff27143582f595dbf438d3fa41b
parent34f938a9992f312c2f6619e383dae0a2b6899275 (diff)
mark getc uses with regard to int and EOF
-rw-r--r--usr.bin/tip/tip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c
index 64cd7602153..977e2c976ab 100644
--- a/usr.bin/tip/tip.c
+++ b/usr.bin/tip/tip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.c,v 1.15 2001/10/24 18:38:58 millert Exp $ */
+/* $OpenBSD: tip.c,v 1.16 2002/02/25 00:20:19 deraadt Exp $ */
/* $NetBSD: tip.c,v 1.13 1997/04/20 00:03:05 mellon Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tip.c,v 1.15 2001/10/24 18:38:58 millert Exp $";
+static char rcsid[] = "$OpenBSD: tip.c,v 1.16 2002/02/25 00:20:19 deraadt Exp $";
#endif /* not lint */
/*
@@ -370,7 +370,8 @@ intprompt()
void
tipin()
{
- char gch, bol = 1;
+ char bol = 1;
+ int gch;
/*
* Kinda klugey here...
@@ -386,6 +387,7 @@ tipin()
while (1) {
gch = getchar()&STRIP_PAR;
+ /* XXX does not check for EOF */
if ((gch == character(value(ESCAPE))) && bol) {
if (!noesc) {
if (!(gch = escape()))
@@ -420,11 +422,12 @@ extern esctable_t etable[];
int
escape()
{
- char gch;
+ int gch;
esctable_t *p;
char c = character(value(ESCAPE));
gch = (getchar()&STRIP_PAR);
+ /* XXX does not check for EOF */
for (p = etable; p->e_char; p++)
if (p->e_char == gch) {
if ((p->e_flags&PRIV) && uid)