*: fix format string warnings

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2020-03-27 13:14:37 +01:00
parent 07ef3e34ae
commit 566bdaf68c
8 changed files with 22 additions and 20 deletions

View File

@ -243,17 +243,17 @@ static int parse_peer_config(struct json_object *jo, struct bfd_peer_cfg *bpc)
} else if (strcmp(key, "receive-interval") == 0) {
bpc->bpc_recvinterval = json_object_get_int64(jo_val);
bpc->bpc_has_recvinterval = true;
log_debug(" receive-interval: %llu",
log_debug(" receive-interval: %" PRIu64,
bpc->bpc_recvinterval);
} else if (strcmp(key, "transmit-interval") == 0) {
bpc->bpc_txinterval = json_object_get_int64(jo_val);
bpc->bpc_has_txinterval = true;
log_debug(" transmit-interval: %llu",
log_debug(" transmit-interval: %" PRIu64,
bpc->bpc_txinterval);
} else if (strcmp(key, "echo-interval") == 0) {
bpc->bpc_echointerval = json_object_get_int64(jo_val);
bpc->bpc_has_echointerval = true;
log_debug(" echo-interval: %llu",
log_debug(" echo-interval: %" PRIu64,
bpc->bpc_echointerval);
} else if (strcmp(key, "create-only") == 0) {
bpc->bpc_createonly = json_object_get_boolean(jo_val);

View File

@ -471,7 +471,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
if (pnt != lim) {
flog_err(
EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / L-U (%zu data remaining after parsing)",
"%s [Error] Update packet error / L-U (%td data remaining after parsing)",
peer->host, lim - pnt);
return BGP_NLRI_PARSE_ERROR_PACKET_LENGTH;
}

View File

@ -244,7 +244,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
if (pnt != lim) {
flog_err(
EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / VPN (%zu data remaining after parsing)",
"%s [Error] Update packet error / VPN (%td data remaining after parsing)",
peer->host, lim - pnt);
return BGP_NLRI_PARSE_ERROR_PACKET_LENGTH;
}

View File

@ -9121,10 +9121,12 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
vty_out(vty, "%*s", max_neighbor_width - len,
" ");
vty_out(vty, "4 %10u %9u %9u %8" PRIu64 " %4d %4zd %8s",
vty_out(vty,
"4 %10u %9u %9u %8" PRIu64 " %4d %4zu %8s",
peer->as, PEER_TOTAL_RX(peer),
PEER_TOTAL_TX(peer), peer->version[afi][safi],
0, peer->obuf->count,
PEER_TOTAL_TX(peer),
peer->version[afi][safi], 0,
peer->obuf->count,
peer_uptime(peer->uptime, timebuf,
BGP_UPTIME_LEN, 0, NULL));

View File

@ -778,7 +778,7 @@ static void __attribute__((unused)) prefix_list_print(struct prefix_list *plist)
p = &pentry->prefix;
printf(" seq %" PRId64 " %s %s/%d", pentry->seq,
printf(" seq %lld %s %s/%d", (long long)pentry->seq,
prefix_list_type_str(pentry),
inet_ntop(p->family, p->u.val, buf, BUFSIZ),
p->prefixlen);

View File

@ -114,11 +114,10 @@ static void vty_out_cpu_thread_history(struct vty *vty,
struct cpu_thread_history *a)
{
vty_out(vty, "%5zu %10zu.%03zu %9zu %8zu %9zu %8zu %9zu",
(size_t)a->total_active,
a->cpu.total / 1000, a->cpu.total % 1000,
(size_t)a->total_calls,
a->cpu.total / a->total_calls, a->cpu.max,
a->real.total / a->total_calls, a->real.max);
(size_t)a->total_active, a->cpu.total / 1000,
a->cpu.total % 1000, (size_t)a->total_calls,
(size_t)(a->cpu.total / a->total_calls), a->cpu.max,
(size_t)(a->real.total / a->total_calls), a->real.max);
vty_out(vty, " %c%c%c%c%c %s\n",
a->types & (1 << THREAD_READ) ? 'R' : ' ',
a->types & (1 << THREAD_WRITE) ? 'W' : ' ',

View File

@ -22,6 +22,7 @@
#include "log.h"
#include "lib_errors.h"
#include "northbound.h"
#include "printfrr.h"
static const char *yang_get_default_value(const char *xpath)
{
@ -443,7 +444,7 @@ struct yang_data *yang_data_new_int64(const char *xpath, int64_t value)
{
char value_str[BUFSIZ];
snprintf(value_str, sizeof(value_str), "%" PRId64, value);
snprintfrr(value_str, sizeof(value_str), "%" PRId64, value);
return yang_data_new(xpath, value_str);
}
@ -651,7 +652,7 @@ struct yang_data *yang_data_new_uint64(const char *xpath, uint64_t value)
{
char value_str[BUFSIZ];
snprintf(value_str, sizeof(value_str), "%" PRIu64, value);
snprintfrr(value_str, sizeof(value_str), "%" PRIu64, value);
return yang_data_new(xpath, value_str);
}

View File

@ -473,7 +473,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)
case PIM_MSG_ADDRESS_FAMILY_IPV4:
if ((addr + sizeof(struct in_addr)) > pastend) {
zlog_warn(
"%s: IPv4 unicast address overflow: left=%zd needed=%zu",
"%s: IPv4 unicast address overflow: left=%td needed=%zu",
__func__, pastend - addr,
sizeof(struct in_addr));
return -3;
@ -489,7 +489,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)
case PIM_MSG_ADDRESS_FAMILY_IPV6:
if ((addr + sizeof(struct in6_addr)) > pastend) {
zlog_warn(
"%s: IPv6 unicast address overflow: left=%zd needed %zu",
"%s: IPv6 unicast address overflow: left=%td needed %zu",
__func__, pastend - addr,
sizeof(struct in6_addr));
return -3;
@ -548,7 +548,7 @@ int pim_parse_addr_group(struct prefix_sg *sg, const uint8_t *buf, int buf_size)
if ((addr + sizeof(struct in_addr)) > pastend) {
zlog_warn(
"%s: IPv4 group address overflow: left=%zd needed=%zu from",
"%s: IPv4 group address overflow: left=%td needed=%zu from",
__func__, pastend - addr,
sizeof(struct in_addr));
return -3;
@ -607,7 +607,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,
case PIM_MSG_ADDRESS_FAMILY_IPV4:
if ((addr + sizeof(struct in_addr)) > pastend) {
zlog_warn(
"%s: IPv4 source address overflow: left=%zd needed=%zu",
"%s: IPv4 source address overflow: left=%td needed=%zu",
__func__, pastend - addr,
sizeof(struct in_addr));
return -3;