From 19ff2ab337c997a28964c88f5124a07dff48a0e4 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 14 Mar 2000 01:47:19 +0000 Subject: Fix some printf-style argument bugs --- usr.sbin/ppp/bundle.c | 16 +++++++++------- usr.sbin/ppp/ipcp.c | 3 ++- usr.sbin/ppp/mbuf.c | 6 +++--- usr.sbin/ppp/nat_cmd.c | 4 ++-- usr.sbin/ppp/physical.c | 4 ++-- usr.sbin/ppp/slcompress.c | 4 ++-- 6 files changed, 20 insertions(+), 17 deletions(-) (limited to 'usr.sbin/ppp') diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 859a63e..f9a9cce 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -1439,14 +1439,15 @@ bundle_ReceiveDatalink(struct bundle *bundle, int s) msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof cmsgbuf; - log_Printf(LogDEBUG, "Expecting %d scatter/gather bytes\n", iov[0].iov_len); + log_Printf(LogDEBUG, "Expecting %u scatter/gather bytes\n", + (unsigned)iov[0].iov_len); if ((got = recvmsg(s, &msg, MSG_WAITALL)) != iov[0].iov_len) { if (got == -1) log_Printf(LogERROR, "Failed recvmsg: %s\n", strerror(errno)); else - log_Printf(LogERROR, "Failed recvmsg: Got %d, not %d\n", - got, iov[0].iov_len); + log_Printf(LogERROR, "Failed recvmsg: Got %d, not %u\n", + got, (unsigned)iov[0].iov_len); while (niov--) free(iov[niov].iov_base); return; @@ -1623,15 +1624,16 @@ bundle_SendDatalink(struct datalink *dl, int s, struct sockaddr_un *sun) log_Printf(LogERROR, "setsockopt(SO_RCVBUF, %d): %s\n", expect, strerror(errno)); - log_Printf(LogDEBUG, "Sending %d descriptor%s and %d bytes in scatter" - "/gather array\n", nfd, nfd == 1 ? "" : "s", iov[0].iov_len); + log_Printf(LogDEBUG, "Sending %d descriptor%s and %u bytes in scatter" + "/gather array\n", nfd, nfd == 1 ? "" : "s", + (unsigned)iov[0].iov_len); if ((got = sendmsg(s, &msg, 0)) == -1) log_Printf(LogERROR, "Failed sendmsg: %s: %s\n", sun->sun_path, strerror(errno)); else if (got != iov[0].iov_len) - log_Printf(LogERROR, "%s: Failed initial sendmsg: Only sent %d of %d\n", - sun->sun_path, got, iov[0].iov_len); + log_Printf(LogERROR, "%s: Failed initial sendmsg: Only sent %d of %u\n", + sun->sun_path, got, (unsigned)iov[0].iov_len); else { /* We must get the ACK before closing the descriptor ! */ int res; diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c index 6e3260b..7ae6a3c 100644 --- a/usr.sbin/ppp/ipcp.c +++ b/usr.sbin/ppp/ipcp.c @@ -371,7 +371,8 @@ ipcp_Show(struct cmdargs const *arg) inet_ntoa(ipcp->peer_ip), vj2asc(ipcp->peer_compproto)); prompt_Printf(arg->prompt, " My side: %s, %s\n", inet_ntoa(ipcp->my_ip), vj2asc(ipcp->my_compproto)); - prompt_Printf(arg->prompt, " Queued packets: %d\n", ip_QueueLen(ipcp)); + prompt_Printf(arg->prompt, " Queued packets: %lu\n", + (unsigned long)ip_QueueLen(ipcp)); } if (ipcp->route) { diff --git a/usr.sbin/ppp/mbuf.c b/usr.sbin/ppp/mbuf.c index 5bd58dc..5d51358 100644 --- a/usr.sbin/ppp/mbuf.c +++ b/usr.sbin/ppp/mbuf.c @@ -112,8 +112,8 @@ m_get(size_t m_len, int type) */ *mb = (struct mbucket *)malloc(BUCKET_CHUNK * size); if (*mb == NULL) { - log_Printf(LogALERT, "Failed to allocate memory (%u)\n", - BUCKET_CHUNK * size); + log_Printf(LogALERT, "Failed to allocate memory (%lu)\n", + (unsigned long)BUCKET_CHUNK * size); AbortProgram(EX_OSERR); } bp = &(*mb)->u.m; @@ -354,7 +354,7 @@ m_enqueue(struct mqueue *queue, struct mbuf *bp) } else queue->last = queue->top = bp; queue->len++; - log_Printf(LogDEBUG, "m_enqueue: len = %d\n", queue->len); + log_Printf(LogDEBUG, "m_enqueue: len = %lu\n", (unsigned long)queue->len); } } diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c index ed7876d..490ef73 100644 --- a/usr.sbin/ppp/nat_cmd.c +++ b/usr.sbin/ppp/nat_cmd.c @@ -383,8 +383,8 @@ nat_LayerPull(struct bundle *bundle, struct link *l, struct mbuf *bp, bp->m_len = ntohs(pip->ip_len); if (bp->m_len > MAX_MRU) { - log_Printf(LogWARN, "nat_LayerPull: Problem with IP header length (%d)\n", - bp->m_len); + log_Printf(LogWARN, "nat_LayerPull: Problem with IP header length (%lu)\n", + (unsigned long)bp->m_len); m_freem(bp); return NULL; } diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index f20f2d3..611796e 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -385,8 +385,8 @@ physical_DescriptorWrite(struct fdescriptor *d, struct bundle *bundle, if (p->out) { nw = physical_Write(p, MBUF_CTOP(p->out), p->out->m_len); - log_Printf(LogDEBUG, "%s: DescriptorWrite: wrote %d(%d) to %d\n", - p->link.name, nw, p->out->m_len, p->fd); + log_Printf(LogDEBUG, "%s: DescriptorWrite: wrote %d(%lu) to %d\n", + p->link.name, nw, (unsigned long)p->out->m_len, p->fd); if (nw > 0) { p->out->m_len -= nw; p->out->m_offset += nw; diff --git a/usr.sbin/ppp/slcompress.c b/usr.sbin/ppp/slcompress.c index d5fa74c..75b952e 100644 --- a/usr.sbin/ppp/slcompress.c +++ b/usr.sbin/ppp/slcompress.c @@ -154,8 +154,8 @@ sl_compress_tcp(struct mbuf * m, * the caller has already made sure the packet is IP proto TCP). */ if ((ip->ip_off & htons(0x3fff)) || m->m_len < 40) { - log_Printf(LogDEBUG, "??? 1 ip_off = %x, m_len = %d\n", - ip->ip_off, m->m_len); + log_Printf(LogDEBUG, "??? 1 ip_off = %x, m_len = %lu\n", + ip->ip_off, (unsigned long)m->m_len); log_DumpBp(LogDEBUG, "", m); return (TYPE_IP); } -- cgit v1.1