Subject: misc/2055: cribbage displays incorrectly and rushes through things
To: None <gnats-bugs@NetBSD.ORG>
From: James Graham (Captech) <greywolf@strikeforce.vas.viewlogic.com>
List: netbsd-bugs
Date: 02/09/1996 13:39:13
>Number:         2055
>Category:       misc
>Synopsis:       cribbage displays incorrectly and rushes through things
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb  9 23:20:01 1996
>Last-Modified:
>Originator:     greywolf@viewlogic.com
>Organization:
none
>Release:        NetBSD-current 8 Feb 1996
>Environment:
	SS1+	NetBSD-current/SPARC
System: NetBSD strikeforce 1.1A NetBSD 1.1A (STRIKEFORCE) #5: Tue Feb 6 15:42:21 PST 1996 root@strikeforce:/usr/src/sys/arch/sparc/compile/STRIKEFORCE sparc


>Description:
	Cribbage does not display properly, and it does not wait for
	player to see what computer has in crib (among other things).
>How-To-Repeat:
	Run '/usr/games/cribbage'.
>Fix:
/* cribbage.patch00 */
--- crib.c	Fri Feb  9 13:12:30 1996
+++ crib.c.1.1	Fri Feb  9 13:11:51 1996
@@ -226,12 +226,10 @@
 			} else
 				compcrib = (deck[i].rank > deck[j].rank);
 		} while (flag);
-		do_wait();
 		clear();
 		makeboard();
 		refresh();
 	} else {
-		makeboard();
 		werase(Tablewin);
 		wrefresh(Tablewin);
 		werase(Compwin);
@@ -239,7 +237,6 @@
 		msg("Loser (%s) gets first crib", (iwon ? "you" : "me"));
 		compcrib = !iwon;
 	}
-	do_wait();
 
 	pscore = cscore = 0;
 	flag = TRUE;
@@ -583,7 +580,6 @@
 		} else {
 			msg(quiet ? "You get one for last" :
 			    "You get one point for last");
-			do_wait();
 			if (chkscr(&pscore, 1))
 				return TRUE;
 		}
@@ -611,7 +607,6 @@
 score(mycrib)
 	BOOLEAN mycrib;
 {
-    register i;
 	sorthand(crib, CINHAND);
 	if (mycrib) {
 		if (plyrhand(phand, "hand"))
@@ -619,11 +614,8 @@
 		if (comphand(chand, "hand"))
 			return (TRUE);
 		do_wait();
-		i = comphand(crib, "crib");
-		do_wait();
-		if (i) {
+		if (comphand(crib, "crib"))
 			return (TRUE);
-		}
 	} else {
 		if (comphand(chand, "hand"))
 			return (TRUE);
--- cribbage.h	Fri Feb  9 13:31:23 1996
+++ cribbage.h.1.1	Fri Feb  9 13:11:51 1996
@@ -61,19 +61,6 @@
 
 extern  char		expl[];			/* string for explanation */
 
-#ifdef NEED_PROTOTYPES
-#ifdef __STDC__
-#define __P(x) x
-#else
-#define __P(x) ()
-#endif
-#endif
-
-#ifdef NEED_STRERROR
-extern char *sys_errlist[];
-#define strerror(x) sys_errlist[x]
-#endif
-
 void	 addmsg __P((const char *, ...));
 int	 adjust __P((CARD [], CARD));
 int	 anymove __P((CARD [], int, int));
--- instr.c	Fri Feb  9 13:12:29 1996
+++ instr.c.1.1	Fri Feb  9 13:11:52 1996
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.c,v 1.3 1995/03/21 15:08:52 cgd Exp $	*/
+/*	$NetBSD: instr.c,v 1.4 1996/02/06 22:47:18 jtc Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,13 +37,12 @@
 #if 0
 static char sccsid[] = "@(#)instr.c	8.1 (Berkeley) 5/31/93";
 #else
-static char rcsid[] = "$NetBSD: instr.c,v 1.3 1995/03/21 15:08:52 cgd Exp $";
+static char rcsid[] = "$NetBSD: instr.c,v 1.4 1996/02/06 22:47:18 jtc Exp $";
 #endif
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <sys/errno.h>
 #include <sys/stat.h>
 
 #include <curses.h>
@@ -51,6 +50,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "deck.h"
 #include "cribbage.h"
@@ -59,7 +59,6 @@
 void
 instructions()
 {
-	extern int errno;
 	struct stat sb;
 	union wait pstat;
 	pid_t pid;
--- io.c	Fri Feb  9 13:12:29 1996
+++ io.c.1.1	Fri Feb  9 13:11:52 1996
@@ -432,7 +432,6 @@
 	va_start(ap);
 #endif
 	(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
-	Newpos = strlen(Msgbuf);
 	va_end(ap);
 }
 
>Audit-Trail:
>Unformatted: