]> arthur.barton.de Git - ngircd.git/commitdiff
Explicitely cast NumConnections etc. (size_t) to "long"
authorAlexander Barton <alex@barton.de>
Fri, 26 Apr 2024 12:29:28 +0000 (14:29 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 26 Apr 2024 12:29:28 +0000 (14:29 +0200)
This fixes the following compiler warning, for example on OpenSolaris:

  conn.c: In function 'Conn_Handler':
  conn.c:798:28: warning: format '%ld' expects argument of type 'long int',
    but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]

src/ngircd/conn.c

index b7838ea857e723cab0a16ee52d3f835d4ddc3e88..68a901d05e6a066aee87cadeb9e1f51d21873a5d 100644 (file)
@@ -796,10 +796,10 @@ Conn_Handler(void)
                        /* Send the current status to the service manager. */
                        snprintf(status, sizeof(status),
                                 "WATCHDOG=1\nSTATUS=%ld connection%s established (%ld user%s, %ld server%s), %ld maximum. %ld accepted in total.\n",
-                                NumConnections, NumConnections == 1 ? "" : "s",
+                                (long)NumConnections, NumConnections == 1 ? "" : "s",
                                 Client_MyUserCount(), Client_MyUserCount() == 1 ? "" : "s",
                                 Client_MyServerCount(), Client_MyServerCount() == 1 ? "" : "s",
-                                NumConnectionsMax, NumConnectionsAccepted);
+                                (long)NumConnectionsMax, (long)NumConnectionsAccepted);
                        Signal_NotifySvcMgr(status);
                        notify_t = t;
                }