Skip to content

Commit

Permalink
udp: fix win32 warnings (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Feb 23, 2022
1 parent baeb1f9 commit 8f8a84c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/udp/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void udp_read(struct udp_sock *us, int fd)

src.len = sizeof(src.u);
n = recvfrom(fd, BUF_CAST mb->buf + us->rx_presz,
mb->size - us->rx_presz, 0,
SIZ_CAST mb->size - us->rx_presz, 0,
&src.u.sa, &src.len);
if (n < 0) {
err = errno;
Expand Down Expand Up @@ -517,12 +517,14 @@ static int udp_send_internal(struct udp_sock *us, const struct sa *dst,

/* Connected socket? */
if (us->conn) {
if (send(fd, BUF_CAST mb->buf + mb->pos, mb->end - mb->pos,
if (send(fd, BUF_CAST mb->buf + mb->pos,
SIZ_CAST mb->end - mb->pos,
0) < 0)
return errno;
}
else {
if (sendto(fd, BUF_CAST mb->buf + mb->pos, mb->end - mb->pos,
if (sendto(fd, BUF_CAST mb->buf + mb->pos,
SIZ_CAST mb->end - mb->pos,
0, &dst->u.sa, dst->len) < 0)
return errno;
}
Expand Down

0 comments on commit 8f8a84c

Please sign in to comment.