From a9b0775969021bce380ce24938ae001d2d852a43 Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 21 Jan 2025 05:35:16 +0200 Subject: [PATCH] fix -Wliteral-suffix --- src/irc.c | 12 ++++++------ src/main.c | 2 +- src/net.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/irc.c b/src/irc.c index 5ef1ed0..7609d8a 100644 --- a/src/irc.c +++ b/src/irc.c @@ -11,7 +11,7 @@ map_t autojoin = {0}; const char *hostname = IRCDHOSTNAME; void sendbuf(struct client_data *client) { - fprintf(stderr, "SERVER %"PRISocket": %.*s", client->FD, (int)databuf.len, (char*)databuf.buf); + fprintf(stderr, "SERVER %" PRISocket ": %.*s", client->FD, (int)databuf.len, (char*)databuf.buf); sendClient(client, databuf.buf, databuf.len); } static void chanlog_time(time_t timestamp) { @@ -122,12 +122,12 @@ int parsePacket(struct client_data *client) { if (end > p && end[-1] == '\r') *--end = '\n'; if (memchr(p, '\0', end-p)) { - fprintf(stderr, "Client %"PRISocket" sent a NULL\n", client->FD); + fprintf(stderr, "Client %" PRISocket " sent a NULL\n", client->FD); killConnection(client, 0); return 1; // null detected } if (memchr(p, '\r', end-p)) { - fprintf(stderr, "Client %"PRISocket" sent an extra CR\n", client->FD); + fprintf(stderr, "Client %" PRISocket " sent an extra CR\n", client->FD); killConnection(client, 0); return 1; // internal \r detected } @@ -172,7 +172,7 @@ int parsePacket(struct client_data *client) { } args[argc] = NULL; } - fprintf(stderr, "parsed %"PRISocket": %s", client->FD, command); + fprintf(stderr, "parsed %" PRISocket ": %s", client->FD, command); if (strcmp(command, "PASS") != 0 && strcmp(command, "OPER") != 0 && strcmp(command, "NEWACC") != 0 && strcmp(command, "AUTHENTICATE") != 0 && strcmp(command, "WEBIRC") != 0) { for (int i = 0; i < argc; i++){ @@ -1240,7 +1240,7 @@ void newUser(struct client_data *client) { #ifdef HAS_TLS // TODO: move this when we add sasl if (client->cctx && tls_peer_cert_provided(client->cctx)) - fprintf(stderr, "CertFP %"PRISocket": %s\n", client->FD, tls_peer_cert_hash(client->cctx)); + fprintf(stderr, "CertFP %" PRISocket ": %s\n", client->FD, tls_peer_cert_hash(client->cctx)); #endif rpl_welcome(client), sendbuf(client); rpl_yourhost(client), sendbuf(client); @@ -1649,7 +1649,7 @@ void channel_mode(struct client_data *client, struct channel *chan, char *args[] case '+': is_plus = 1; break; case '-': is_plus = 0; break; #define MSG_CHANDMODE(m) \ - copy_strf(&databuf, ":%s!%s@%s MODE %s %s"m"\r\n", \ + copy_strf(&databuf, ":%s!%s@%s MODE %s %s" m "\r\n", \ n, u, h, chan->name, is_plus?"+":"-") case 'P': if (client && !(client->umode & UMODE_OPER)) diff --git a/src/main.c b/src/main.c index 0536567..845a3b7 100644 --- a/src/main.c +++ b/src/main.c @@ -191,7 +191,7 @@ static void accept_from_sock(struct listener *listener) strcpy_lit(client_addr, "?"); port = 0; } - fprintf(stderr, "Connection accepted from Socket: %"PRISocket", IP: %s PORT: %d\n", newSocket, + fprintf(stderr, "Connection accepted from Socket: %" PRISocket ", IP: %s PORT: %d\n", newSocket, client_addr, port); struct tls *cctx = NULL; if (listener->ctx) { diff --git a/src/net.c b/src/net.c index 44b47b6..68e659b 100644 --- a/src/net.c +++ b/src/net.c @@ -43,7 +43,7 @@ void killConnection(struct client_data *cl, int byChoice) cl->dying = 1; job_kill(cl); if (cl->peername) - fprintf(stderr, "Client disconnected from Socket: %"PRISocket", IP: %s PORT: %d\n", cl->FD, cl->peername, cl->peerport); + fprintf(stderr, "Client disconnected from Socket: %" PRISocket ", IP: %s PORT: %d\n", cl->FD, cl->peername, cl->peerport); if (!byChoice && cl->nick && cl->username) { msg_quit(cl, "", "Has left the building (Forced)"); sendbuf_visible(cl); @@ -108,7 +108,7 @@ void killConnectionPart2(struct client_data *cl) return; } if (rv == -1) { - fprintf(stderr, "tls_close (%"PRISocket"): %s\n", cl->FD, tls_error(cl->cctx)); + fprintf(stderr, "tls_close (%" PRISocket "): %s\n", cl->FD, tls_error(cl->cctx)); } tls_free(cl->cctx); cl->cctx = NULL; -- 2.56.0