]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
input: UNIXSOCK: correct format specifiers
authorJeremy Sowden <jeremy@azazel.net>
Sun, 21 Nov 2021 20:41:38 +0000 (20:41 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 23 Nov 2021 13:24:53 +0000 (14:24 +0100)
There are a couple of logging calls which use the wrong specifiers for
their integer arguments.  Change the specifiers to match the arguments.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
input/packet/ulogd_inppkt_UNIXSOCK.c

index 39944bf5cdb151de81b2d27d1e6babb0a28a2670..86ab590073d82de858a2a2dc7477e17643e27c5b 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include <inttypes.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <netinet/ether.h>
@@ -632,9 +633,9 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
                packet_sig = ntohl(unixsock_packet->marker);
                if (packet_sig != ULOGD_SOCKET_MARK) {
                        ulogd_log(ULOGD_ERROR,
-                               "ulogd2: invalid packet marked received "
-                               "(read %lx, expected %lx), closing socket.\n",
-                               packet_sig, ULOGD_SOCKET_MARK);
+                                 "ulogd2: invalid packet marked received "
+                                 "(read %" PRIx32 ", expected %" PRIx32 "), closing socket.\n",
+                                 packet_sig, ULOGD_SOCKET_MARK);
                        _disconnect_client(ui);
                        return -1;
 
@@ -663,8 +664,8 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
                        }
 
                } else {
-                       ulogd_log(ULOGD_DEBUG, "  We have %d bytes, but need %d. Requesting more\n",
-                                       ui->unixsock_buf_avail, needed_len + sizeof(uint32_t));
+                       ulogd_log(ULOGD_DEBUG, "  We have %u bytes, but need %zu. Requesting more\n",
+                                 ui->unixsock_buf_avail, needed_len + sizeof(uint32_t));
                        return 0;
                }