summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/pf_key_v2.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-01 07:44:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-01 07:44:23 +0000
commitf513dc36f4e8026dcc54d6eca9240142830b7670 (patch)
treea7695df419f6006fc1e66fb26caedd25d34087d7 /sbin/isakmpd/pf_key_v2.c
parent715efc5fb1f53da06a4bbf265ecf4758c59b5f52 (diff)
size_t must be cast to (unsigned long) and printed using %lu
Diffstat (limited to 'sbin/isakmpd/pf_key_v2.c')
-rw-r--r--sbin/isakmpd/pf_key_v2.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index a9e4149a0ba..d5df1a8c790 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.101 2002/05/31 02:16:55 angelos Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.102 2002/06/01 07:44:22 deraadt Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -301,9 +301,9 @@ pf_key_v2_read (u_int32_t seq)
sizeof (fd_mask));
if (!fds)
{
- log_error ("pf_key_v2_read: calloc (%d, %d) failed",
- howmany (pf_key_v2_socket + 1, NFDBITS),
- sizeof (fd_mask));
+ log_error ("pf_key_v2_read: calloc (%lu, %lu) failed",
+ (unsigned long)howmany (pf_key_v2_socket + 1, NFDBITS),
+ (unsigned long)sizeof (fd_mask));
goto cleanup;
}
FD_SET (pf_key_v2_socket, fds);
@@ -333,7 +333,7 @@ pf_key_v2_read (u_int32_t seq)
if (n != sizeof hdr)
{
log_error ("pf_key_v2_read: recv (%d, ...) returned short packet "
- "(%d bytes)",
+ "(%lu bytes)",
pf_key_v2_socket, n);
goto cleanup;
}
@@ -342,7 +342,7 @@ pf_key_v2_read (u_int32_t seq)
buf = malloc (n);
if (!buf)
{
- log_error ("pf_key_v2_read: malloc (%d) failed", n);
+ log_error ("pf_key_v2_read: malloc (%lu) failed", (unsigned long)n);
goto cleanup;
}
@@ -357,8 +357,8 @@ pf_key_v2_read (u_int32_t seq)
if ((size_t)n != hdr.sadb_msg_len * PF_KEY_V2_CHUNK)
{
log_print ("pf_key_v2_read: read (%d, ...) returned short packet "
- "(%d bytes)",
- pf_key_v2_socket, n);
+ "(%lu bytes)",
+ pf_key_v2_socket, (unsigned long)n);
goto cleanup;
}
@@ -434,7 +434,8 @@ pf_key_v2_write (struct pf_key_v2_msg *pmsg)
iov = (struct iovec *)malloc (cnt * sizeof *iov);
if (!iov)
{
- log_error ("pf_key_v2_write: malloc (%d) failed", cnt * sizeof *iov);
+ log_error ("pf_key_v2_write: malloc (%lu) failed",
+ cnt * (unsigned long)sizeof *iov);
return 0;
}
@@ -478,8 +479,8 @@ pf_key_v2_write (struct pf_key_v2_msg *pmsg)
}
if ((size_t)n != len)
{
- log_error ("pf_key_v2_write: writev (%d, ...) returned prematurely (%d)",
- pf_key_v2_socket, n);
+ log_error ("pf_key_v2_write: writev (%d, ...) returned prematurely (%lu)",
+ pf_key_v2_socket, (unsigned long)n);
goto cleanup;
}
free (iov);
@@ -3793,8 +3794,8 @@ pf_key_v2_acquire (struct pf_key_v2_msg *pmsg)
authm = malloc (sauth->sadb_x_cred_len - sizeof *sauth + 1);
if (!authm)
{
- log_error ("pf_key_v2_set_spi: malloc (%d) failed",
- sauth->sadb_x_cred_len - sizeof *sauth + 1);
+ log_error ("pf_key_v2_set_spi: malloc (%lu) failed",
+ sauth->sadb_x_cred_len - (unsigned long)sizeof *sauth + 1);
conf_end (af, 0);
goto fail;
}
@@ -3835,8 +3836,8 @@ pf_key_v2_acquire (struct pf_key_v2_msg *pmsg)
if (!authm)
{
log_print ("pf_key_v2_set_spi: failed to convert "
- "private key to printable format (size %d)",
- sauth->sadb_x_cred_len - sizeof *sauth);
+ "private key to printable format (size %lu)",
+ sauth->sadb_x_cred_len - (unsigned long)sizeof *sauth);
conf_end (af, 0);
goto fail;
}