]> PatchyGit - patchyircd.git/commitdiff
fix -Wliteral-suffix
authorEgor <egor@patchysicp.xyz>
Tue, 21 Jan 2025 03:35:16 +0000 (05:35 +0200)
committerEgor <egor@patchysicp.xyz>
Tue, 21 Jan 2025 03:35:16 +0000 (05:35 +0200)
src/irc.c
src/main.c
src/net.c

index 5ef1ed0..7609d8a 100644 (file)
--- 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))
index 0536567..845a3b7 100644 (file)
@@ -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) {
index 44b47b6..68e659b 100644 (file)
--- 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;