Skip to content

Commit abe66fb

Browse files
committed
yutani: pex read() can return error code
1 parent f84466b commit abe66fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/yutani.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ yutani_msg_t * yutani_poll(yutani_t * y) {
120120
return out;
121121
}
122122

123-
size_t size;
123+
ssize_t size;
124124
{
125125
char tmp[MAX_PACKET_SIZE];
126126
size = pex_recv(y->sock, tmp);
127+
if (size <= 0) return NULL;
127128
out = malloc(size);
128129
memcpy(out, tmp, size);
129130
}

0 commit comments

Comments
 (0)