mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-20 19:04:49 +00:00
adventure: Fix crc code to not segfault on 64 bit architectures. Closes: #477768
This commit is contained in:
@@ -42,6 +42,8 @@ __RCSID("$NetBSD: crc.c,v 1.8 2003/08/07 09:36:50 agc Exp $");
|
|||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
const unsigned long crctab[] = {
|
const unsigned long crctab[] = {
|
||||||
@@ -125,7 +127,7 @@ crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
|
|||||||
|
|
||||||
while (nr > 0)
|
while (nr > 0)
|
||||||
for (p = ptr; nr--; ++p) {
|
for (p = ptr; nr--; ++p) {
|
||||||
if (!(i = crcval >> 24 ^ *p)) {
|
if (!(i = crcval >> (sizeof(crcval) * CHAR_BIT - 8) ^ *p)) {
|
||||||
i = step++;
|
i = step++;
|
||||||
if (step >= sizeof(crctab) / sizeof(crctab[0]))
|
if (step >= sizeof(crctab) / sizeof(crctab[0]))
|
||||||
step = 0;
|
step = 0;
|
||||||
|
|||||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,6 +1,8 @@
|
|||||||
bsdgames (2.17-15) UNRELEASED; urgency=low
|
bsdgames (2.17-15) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* Include rot13 in package description. Closes: #477141
|
* Include rot13 in package description. Closes: #477141
|
||||||
|
* adventure: Fix crc code to not segfault on 64 bit architectures.
|
||||||
|
Closes: #477768
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 21 Apr 2008 12:37:44 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 21 Apr 2008 12:37:44 -0400
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user