From 77949edf212dfa805753ec2d69e3e91181793816 Mon Sep 17 00:00:00 2001 From: thorpej Date: Sat, 29 Mar 1997 20:42:16 +0000 Subject: Make these compile on the PowerPC (an unsigned char system). --- monop/getinp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'monop/getinp.c') diff --git a/monop/getinp.c b/monop/getinp.c index b9e5fcc0..5de77f8d 100644 --- a/monop/getinp.c +++ b/monop/getinp.c @@ -1,4 +1,4 @@ -/* $NetBSD: getinp.c,v 1.4 1995/04/24 12:24:20 cgd Exp $ */ +/* $NetBSD: getinp.c,v 1.5 1997/03/29 20:42:22 thorpej Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: getinp.c,v 1.4 1995/04/24 12:24:20 cgd Exp $"; +static char rcsid[] = "$NetBSD: getinp.c,v 1.5 1997/03/29 20:42:22 thorpej Exp $"; #endif #endif /* not lint */ @@ -56,17 +56,21 @@ char *prompt, *list[]; { reg int i, n_match, match; char *sp; + int c; int plen; static int comp(); for (;;) { inter: printf(prompt); - for (sp = buf; (*sp=getchar()) != '\n'; ) - if (*sp == -1) /* check for interupted system call */ + for (sp = buf; (c=getchar()) != '\n'; ) { + *sp = c; + if (c == -1) /* check for interupted system call */ goto inter; else if (sp != buf || *sp != ' ') sp++; + } + *sp = c; if (buf[0] == '?' && buf[1] == '\n') { printf("Valid inputs are: "); for (i = 0, match = 18; list[i]; i++) { -- cgit v1.2.3-56-ge451