Commit e673a125 authored by dscho's avatar dscho

make compile again with pthreads; fix off-by-one error

parent 1c26789e
...@@ -435,7 +435,8 @@ rfbClientConnectionGone(rfbClientPtr cl) ...@@ -435,7 +435,8 @@ rfbClientConnectionGone(rfbClientPtr cl)
#endif #endif
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
if(cl->screen->backgroundLoop != FALSE) if(cl->screen->backgroundLoop != FALSE) {
int i;
do { do {
LOCK(cl->refCountMutex); LOCK(cl->refCountMutex);
i=cl->refCount; i=cl->refCount;
...@@ -443,6 +444,7 @@ rfbClientConnectionGone(rfbClientPtr cl) ...@@ -443,6 +444,7 @@ rfbClientConnectionGone(rfbClientPtr cl)
if(i>0) if(i>0)
WAIT(cl->deleteCond,cl->refCountMutex); WAIT(cl->deleteCond,cl->refCountMutex);
} while(i>0); } while(i>0);
}
#endif #endif
UNLOCK(rfbClientListMutex); UNLOCK(rfbClientListMutex);
...@@ -547,7 +549,7 @@ rfbProcessClientProtocolVersion(rfbClientPtr cl) ...@@ -547,7 +549,7 @@ rfbProcessClientProtocolVersion(rfbClientPtr cl)
pv[sz_rfbProtocolVersionMsg] = 0; pv[sz_rfbProtocolVersionMsg] = 0;
if (sscanf(pv,rfbProtocolVersionFormat,&major_,&minor_) != 2) { if (sscanf(pv,rfbProtocolVersionFormat,&major_,&minor_) != 2) {
char name[1024]; char name[1024];
if(sscanf(pv,"RFB %03d.%03d %1024s\n",&major_,&minor_,name) != 3) { if(sscanf(pv,"RFB %03d.%03d %1023s\n",&major_,&minor_,name) != 3) {
rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client\n"); rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client\n");
rfbCloseClient(cl); rfbCloseClient(cl);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment