From 4bb61401bd25461a6b8ea44a9fb84a9fdc08de2f Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 10 Oct 2011 22:24:44 -0700 Subject: [PATCH] fix crash: src and dest stream params were reversed. --- xwords4/common/server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index ab972158c..24a1ea5fe 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -313,7 +313,7 @@ readStreamIf( ServerCtxt* server, XWStreamCtxt* in ) XP_U16 len = stream_getU16( in ); if ( 0 < len ) { result = mkServerStream( server ); - stream_copyFromStream( in, result, len ); + stream_copyFromStream( result, in, len ); } return result; } @@ -323,7 +323,9 @@ writeStreamIf( XWStreamCtxt* dest, XWStreamCtxt* src ) { XP_U16 len = !!src ? stream_getSize( src ) : 0; stream_putU16( dest, len ); - stream_copyFromStream( dest, src, len ); + if ( 0 < len ) { + stream_copyFromStream( dest, src, len ); + } } ServerCtxt*