commit 52e05dfe6829e6adfa2201e1ccf1cdc26b91f98d
parent 56309a4479f21084931f7c574fa99c7817629c8c
Author: aabacchus <ben@bvnf.space>
Date: Mon, 21 Jun 2021 09:20:55 +0100
use send(2) instead of write(2)
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
@@ -94,10 +94,11 @@ void usage(const char *argv0){
exit(1);
}
-int ircWrite(char *format, ...){
+int ircWrite(char *msg, ...){
ssize_t ret;
- ret = write(sfd, format, strlen(format));
- if (!ret) perror("ircWrite"); //exit(errno);
+ int len = strlen(msg);
+ ret = send(sfd, msg, len, 0);
+ if (ret != (ssize_t) len) perror("ircWrite"); //exit(errno);
return 0;
}