Skip to content

Commit 1d1153f

Browse files
committed
client_examples/ppmtest: only handle message if wait yielded one
This is more correct and in line with the other examples.
1 parent 97fbbd6 commit 1d1153f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

client_examples/ppmtest.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ main(int argc, char **argv)
102102
while (time(NULL)-t<5) {
103103
static int i=0;
104104
fprintf(stderr,"\r%d",i++);
105-
if(WaitForMessage(client,50)<0)
105+
int n = WaitForMessage(client,50);
106+
if(n < 0)
106107
break;
107-
if(!HandleRFBServerMessage(client))
108+
if(n)
109+
if(!HandleRFBServerMessage(client))
108110
break;
109111
}
110112

0 commit comments

Comments
 (0)