gen_listenerdemo: Fix inadequate check of the return value of recv()

This commit is contained in:
Attila Molnar 2014-09-18 02:02:59 +02:00
parent 6b30dd8bf9
commit 3ab69700ac
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ static void my_rhandler(connection_t * cptr)
{ {
char buf[BUFSIZE * 2]; char buf[BUFSIZE * 2];
if (!my_read(cptr, buf)) if (my_read(cptr, buf) <= 0)
connection_close(cptr); connection_close(cptr);
else else
do_packet(buf); do_packet(buf);