summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-22 17:17:06 (GMT)
committerThomas Haller <thaller@redhat.com>2022-04-22 17:17:06 (GMT)
commitdd06d225083c3423eafc792f2bc1d0562c185c20 (patch)
tree1a5ae0b3cd5f4c95ea7c4e3942b2e632b5fec403
parentf50a802ca28d64dd59d312fe77c9b733378e2db0 (diff)
downloadlibnl-dd06d225083c3423eafc792f2bc1d0562c185c20.zip
libnl-dd06d225083c3423eafc792f2bc1d0562c185c20.tar.gz
libnl-dd06d225083c3423eafc792f2bc1d0562c185c20.tar.bz2
route/qdisc/netem: fix bogus "%" in format string netem_dump_details()
This was wrong. Also, coverity warns about the trailing % in the format string. Error: PRINTF_ARGS (CWE-475): libnl-3.6.0/lib/route/qdisc/netem.c:164: format_error: Format string ended in the middle of specifier "%". # 162|ยทยทยท # 163| if (netem->qnm_mask & SCH_NETEM_ATTR_DELAY_CORR && netem->qnm_corr.nmc_delay > 0) # 164|-> nl_dump(p, " %d%", netem->qnm_corr.nmc_delay); # 165| } # 166| }
-rw-r--r--lib/route/qdisc/netem.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/route/qdisc/netem.c b/lib/route/qdisc/netem.c
index 50122b8..0ca1d57 100644
--- a/lib/route/qdisc/netem.c
+++ b/lib/route/qdisc/netem.c
@@ -161,39 +161,39 @@ static void netem_dump_details(struct rtnl_tc *tc, void *data,
nl_dump(p, " jitter %s", buf);
if (netem->qnm_mask & SCH_NETEM_ATTR_DELAY_CORR && netem->qnm_corr.nmc_delay > 0)
- nl_dump(p, " %d%", netem->qnm_corr.nmc_delay);
+ nl_dump(p, " %d", netem->qnm_corr.nmc_delay);
}
}
if (netem->qnm_mask & SCH_NETEM_ATTR_LOSS && netem->qnm_loss > 0) {
- nl_dump(p, " loss %d%", netem->qnm_loss);
+ nl_dump(p, " loss %d", netem->qnm_loss);
if (netem->qnm_mask & SCH_NETEM_ATTR_LOSS_CORR && netem->qnm_corr.nmc_loss > 0)
- nl_dump(p, " %d%", netem->qnm_corr.nmc_loss);
+ nl_dump(p, " %d", netem->qnm_corr.nmc_loss);
}
if (netem->qnm_mask & SCH_NETEM_ATTR_DUPLICATE && netem->qnm_duplicate > 0) {
- nl_dump(p, " duplicate %d%", netem->qnm_duplicate);
+ nl_dump(p, " duplicate %d", netem->qnm_duplicate);
if (netem->qnm_mask & SCH_NETEM_ATTR_DUP_CORR && netem->qnm_corr.nmc_duplicate > 0)
- nl_dump(p, " %d%", netem->qnm_corr.nmc_duplicate);
+ nl_dump(p, " %d", netem->qnm_corr.nmc_duplicate);
}
if (netem->qnm_mask & SCH_NETEM_ATTR_RO_PROB && netem->qnm_ro.nmro_probability > 0) {
- nl_dump(p, " reorder %d%", netem->qnm_ro.nmro_probability);
+ nl_dump(p, " reorder %d", netem->qnm_ro.nmro_probability);
if (netem->qnm_mask & SCH_NETEM_ATTR_RO_CORR && netem->qnm_ro.nmro_correlation > 0)
- nl_dump(p, " %d%", netem->qnm_ro.nmro_correlation);
+ nl_dump(p, " %d", netem->qnm_ro.nmro_correlation);
if (netem->qnm_mask & SCH_NETEM_ATTR_GAP && netem->qnm_gap > 0)
nl_dump(p, " gap %d", netem->qnm_gap);
}
if (netem->qnm_mask & SCH_NETEM_ATTR_CORRUPT_PROB && netem->qnm_crpt.nmcr_probability > 0) {
- nl_dump(p, " reorder %d%", netem->qnm_crpt.nmcr_probability);
+ nl_dump(p, " reorder %d", netem->qnm_crpt.nmcr_probability);
if (netem->qnm_mask & SCH_NETEM_ATTR_CORRUPT_CORR && netem->qnm_crpt.nmcr_correlation > 0)
- nl_dump(p, " %d%", netem->qnm_crpt.nmcr_correlation);
+ nl_dump(p, " %d", netem->qnm_crpt.nmcr_correlation);
}
}
}