* Fix rounding error in caesar due to too small data type. Caused it to

sometimes make incorrect guesses. Thanks to Jan Vornberger for analysis
     and patch. Also forwarded upstream. Closes: #197816


git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5210 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2003-06-17 23:53:32 +00:00
parent 608349dc00
commit 2c3eb84cdc
2 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: caesar.c,v 1.7 1998/09/13 15:27:27 hubertf Exp $ */
/* $NetBSD: caesar.c,v 1.11 2000/05/08 07:56:02 mycroft Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -51,7 +51,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: caesar.c,v 1.7 1998/09/13 15:27:27 hubertf Exp $");
__RCSID("$NetBSD: caesar.c,v 1.11 2000/05/08 07:56:02 mycroft Exp $");
#endif
#endif /* not lint */
@@ -88,7 +88,8 @@ main(argc, argv)
int argc;
char **argv;
{
int ch, dot, i, nread, winnerdot;
int ch, i, nread;
double dot, winnerdot;
char *inbuf;
int obs[26], try, winner;
@@ -100,7 +101,7 @@ main(argc, argv)
printit(argv[1]);
if (!(inbuf = malloc(LINELENGTH)))
errx(1, "out of memory");
err(1, NULL);
/* adjust frequency table to weight low probs REAL low */
for (i = 0; i < 26; ++i)

8
debian/changelog vendored
View File

@@ -1,3 +1,11 @@
bsdgames (2.14-5) unstable; urgency=low
* Fix rounding error in caesar due to too small data type. Caused it to
sometimes make incorrect guesses. Thanks to Jan Vornberger for analysis
and patch. Also forwarded upstream. Closes: #197816
-- Joey Hess <joeyh@debian.org> Tue, 17 Jun 2003 19:36:44 -0400
bsdgames (2.14-4) unstable; urgency=low
* Move atc and sail to Games/Strategy in menu, cf #194782