aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-03-17 00:07:52 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-03-17 00:07:52 +0100
commit5a926149e5c87d9b9b688e143d6ece02d752e931 (patch)
treeb8936c9ba57e1e3ebb1dededb081a3ff282b9474
parent3adf448e51cc9743ae2bc56ccdba4e7f9ece2b93 (diff)
Usage of sizeof
-rw-r--r--FICS/network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/FICS/network.c b/FICS/network.c
index 4fd0434..10e356d 100644
--- a/FICS/network.c
+++ b/FICS/network.c
@@ -556,9 +556,9 @@ PUBLIC void
turn_echo_on(int fd)
{
int ret;
- static unsigned char wont_echo[] = { IAC, WONT, TELOPT_ECHO, '\0' };
+ static unsigned char wont_echo[] = {IAC, WONT, TELOPT_ECHO, '\0'};
- ret = send(fd, (char *) wont_echo, strlen((char *) wont_echo), 0);
+ ret = send(fd, (char *)wont_echo, sizeof wont_echo - 1, 0);
if (ret == -1)
warn("%s: cannot send", __func__);
}
@@ -567,9 +567,9 @@ PUBLIC void
turn_echo_off(int fd)
{
int ret;
- static unsigned char will_echo[] = { IAC, WILL, TELOPT_ECHO, '\0' };
+ static unsigned char will_echo[] = {IAC, WILL, TELOPT_ECHO, '\0'};
- ret = send(fd, (char *) will_echo, strlen((char *) will_echo), 0);
+ ret = send(fd, (char *)will_echo, sizeof will_echo - 1, 0);
if (ret == -1)
warn("%s: cannot send", __func__);
}