diff --git a/src/net.c b/src/net.c index 5201d69..a9fb7ca 100644 --- a/src/net.c +++ b/src/net.c @@ -113,14 +113,14 @@ bool net_set_timeout(net_t *const n, int usec) { return true; } -ssize_t net_send(net_t *const n, const char *const buf, int buf_len) { +ssize_t net_send(const net_t *const n, const char *const buf, const size_t buf_len) { if (n->fd == -1 || n->raddr.sa_family == AF_UNSPEC) return -1; return sendto(n->fd, buf, buf_len, 0, &n->raddr, sizeof(n->raddr)); } -ssize_t net_recv(net_t *const n, void *const buf, size_t buf_len) { +ssize_t net_recv(net_t *const n, void *const buf, const size_t buf_len) { if (n->fd == -1) return -1; diff --git a/src/net.h b/src/net.h index 8e4bcf2..1ee9207 100644 --- a/src/net.h +++ b/src/net.h @@ -16,7 +16,7 @@ void net_destroy(net_t *n); bool net_set_timeout(net_t *const n, int usec); -ssize_t net_send(net_t *const n, const char *const buf, int buf_len); -ssize_t net_recv(net_t *const n, void *const buf, size_t buf_len); +ssize_t net_send(const net_t *const n, const char *const buf, const size_t buf_len); +ssize_t net_recv(net_t *const n, void *const buf, const size_t buf_len); #endif /* _NET_H_ */