Fix backwards memcpy that breaks netplay.

From Ryan Freeman (MAINTAINER); ok naddy@
This commit is contained in:
bentley 2015-02-24 23:40:02 +00:00
parent 3e56d38030
commit 4f3240bad9
3 changed files with 27 additions and 2 deletions

View File

@ -1,15 +1,16 @@
# $OpenBSD: Makefile,v 1.17 2014/12/11 08:10:51 daniel Exp $
# $OpenBSD: Makefile,v 1.18 2015/02/24 23:40:02 bentley Exp $
COMMENT = portable release of Doom, Heretic, Hexen, and Strife
V = 2.1.0
DISTNAME = chocolate-doom-${V}
CATEGORIES = games x11
REVISION = 0
HOMEPAGE = http://www.chocolate-doom.org/
MAINTAINER = Ryan Freeman <ryan@slipgate.org>
# GPLv2
# GPLv2+
PERMIT_PACKAGE_CDROM = Yes
WANTLIB += SDL SDL_mixer SDL_net c m png pthread samplerate z

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_net_client_c,v 1.1 2015/02/24 23:40:02 bentley Exp $
--- src/net_client.c.orig Tue Feb 24 00:09:49 2015
+++ src/net_client.c Tue Feb 24 00:09:50 2015
@@ -279,7 +279,7 @@ static void NET_CL_AdvanceWindow(void)
// Advance the window
- memcpy(recvwindow, recvwindow + 1,
+ memmove(recvwindow, recvwindow + 1,
sizeof(net_server_recv_t) * (BACKUPTICS - 1));
memset(&recvwindow[BACKUPTICS-1], 0, sizeof(net_server_recv_t));

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_net_server_c,v 1.1 2015/02/24 23:40:02 bentley Exp $
--- src/net_server.c.orig Tue Feb 24 00:09:57 2015
+++ src/net_server.c Tue Feb 24 00:10:04 2015
@@ -514,7 +514,7 @@ static void NET_SV_AdvanceWindow(void)
// Advance the window
- memcpy(recvwindow, recvwindow + 1, sizeof(*recvwindow) * (BACKUPTICS - 1));
+ memmove(recvwindow, recvwindow + 1, sizeof(*recvwindow) * (BACKUPTICS - 1));
memset(&recvwindow[BACKUPTICS-1], 0, sizeof(*recvwindow));
++recvwindow_start;