Skip to content

Commit f00b285

Browse files
authored
Update client.c
1 parent 6d3fe27 commit f00b285

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

TextConferencingLab/LAB1/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void *receive(void *socketfd_void_p) {
3333
fprintf(stderr, "client receive: recv\n");
3434
return NULL;
3535
}
36+
if (numbytes == 0) continue;
3637
buf[numbytes] = 0;
3738
//fprintf(stdout, "buf: %s\n", buf);
3839
stringToPacket(buf, &packet);
@@ -49,7 +50,7 @@ void *receive(void *socketfd_void_p) {
4950
} else if (packet.type == QU_ACK) {
5051
fprintf(stdout, "User id\t\tSession ids\n%s", packet.data);
5152
} else if (packet.type == MESSAGE){
52-
fprintf(stdout, "%s: %s\n", packet.source, packet.data);
53+
fprintf(stdout, "%s: %s\n", packet.source, packet.data);
5354
} else {
5455
fprintf(stdout, "Unexpected packet received: type %d, data %s\n",
5556
packet.type, packet.data);

0 commit comments

Comments
 (0)