segfault after endgame fixed?!
authordisplacer
Wed, 07 Feb 2007 00:30:25 +0000
changeset 406 ea90c6358054
parent 405 339d7735d829
child 407 c7890ba9ed6e
segfault after endgame fixed?!
QTfrontend/game.cpp
--- a/QTfrontend/game.cpp	Tue Feb 06 23:22:32 2007 +0000
+++ b/QTfrontend/game.cpp	Wed Feb 07 00:30:25 2007 +0000
@@ -200,7 +200,7 @@
 {
 	quint8 msglen;
 	quint32 bufsize;
-	while (((bufsize = readbuffer.size()) > 0) &&
+	while (!readbuffer.isEmpty() && ((bufsize = readbuffer.size()) > 0) &&
 			((msglen = readbuffer.data()[0]) < bufsize))
 	{
 		QByteArray msg = readbuffer.left(msglen + 1);