From 6990664f2f8ea1e48dd406d5eda51d550f2328ab Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 24 Mar 2024 16:50:49 +0400 Subject: [PATCH] In net_send() remove a const modifier from buf_len. In net_recv() a const modifier was added to a pointer to buf. --- src/net.c | 4 ++-- src/net.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net.c b/src/net.c index e45db97..d1a5281 100644 --- a/src/net.c +++ b/src/net.c @@ -51,7 +51,7 @@ void net_destroy(net_t *n) { memset(&n->laddr, 0, sizeof(n->laddr)); } -int net_send(net_t *const n, const char *const buf, const int buf_len) { +int net_send(net_t *const n, const char *const buf, int buf_len) { if (n->fd == -1 || n->raddr.sin_addr.s_addr == 0) return -1; @@ -61,7 +61,7 @@ int net_send(net_t *const n, const char *const buf, const int buf_len) { return 0; } -int net_recv(net_t *const n, void *buf, size_t buf_len) { +int net_recv(net_t *const n, void *const buf, size_t buf_len) { if (n->fd == -1 || n->raddr.sin_addr.s_addr == 0) return -1; diff --git a/src/net.h b/src/net.h index f50c160..b05eac2 100644 --- a/src/net.h +++ b/src/net.h @@ -13,7 +13,7 @@ int net_client_init(net_t *const n, const int af_family, const char *const raddr int net_server_init(net_t *const n, const int af_family, const char *const laddr, const int lport); void net_destroy(net_t *n); -int net_send(net_t *const n, const char *const buf, const int buf_len); -int net_recv(net_t *const n, void *buf, size_t buf_len); +int net_send(net_t *const n, const char *const buf, int buf_len); +int net_recv(net_t *const n, void *const buf, size_t buf_len); #endif /* _NET_H_ */ \ No newline at end of file