summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF. Aragon <paco@voltanet.io>2018-07-02 17:32:05 +0200
committerF. Aragon <paco@voltanet.io>2018-07-02 17:50:21 +0200
commit0651460e00282d13f01b5423213a085f9fba2db6 (patch)
tree51d1f699d419748302254e09781e67c4c49789ab
parent8d6d6b2581be7c60ab4913df1adf46098a3dc4ae (diff)
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
-rw-r--r--eigrpd/eigrp_hello.c3
-rw-r--r--nhrpd/nhrp_event.c2
-rw-r--r--ospfd/ospf_ri.c8
-rw-r--r--pimd/pim_zebra.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c
index d9e89357ca..2e55d57c31 100644
--- a/eigrpd/eigrp_hello.c
+++ b/eigrpd/eigrp_hello.c
@@ -417,7 +417,8 @@ void eigrp_sw_version_initialize(void)
if (dash)
dash[0] = '\0';
- ret = sscanf(ver_string, "%d.%d", &FRR_MAJOR, &FRR_MINOR);
+ ret = sscanf(ver_string, "%" SCNu32 ".%" SCNu32, &FRR_MAJOR,
+ &FRR_MINOR);
if (ret != 2)
zlog_err("Did not Properly parse %s, please fix VERSION string",
VERSION);
diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c
index e7adc971e5..7ca9731765 100644
--- a/nhrpd/nhrp_event.c
+++ b/nhrpd/nhrp_event.c
@@ -59,7 +59,7 @@ static void evmgr_recv_message(struct event_manager *evmgr, struct zbuf *zb)
buf[len] = 0;
debugf(NHRP_DEBUG_EVENT, "evmgr: msg: %s", buf);
- if (sscanf(buf, "eventid=%d", &eventid) != 1)
+ if (sscanf(buf, "eventid=%" SCNu32, &eventid) != 1)
continue;
if (sscanf(buf, "result=%63s", result) != 1)
continue;
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c
index 93267156f2..fa7dd04d19 100644
--- a/ospfd/ospf_ri.c
+++ b/ospfd/ospf_ri.c
@@ -1649,7 +1649,7 @@ DEFUN (pce_domain,
if (!ospf_ri_enabled(vty))
return CMD_WARNING_CONFIG_FAILED;
- if (sscanf(argv[idx_number]->arg, "%d", &as) != 1) {
+ if (sscanf(argv[idx_number]->arg, "%" SCNu32, &as) != 1) {
vty_out(vty, "pce_domain: fscanf: %s\n", safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED;
}
@@ -1684,7 +1684,7 @@ DEFUN (no_pce_domain,
uint32_t as;
struct ospf_pce_info *pce = &OspfRI.pce_info;
- if (sscanf(argv[idx_number]->arg, "%d", &as) != 1) {
+ if (sscanf(argv[idx_number]->arg, "%" SCNu32, &as) != 1) {
vty_out(vty, "no_pce_domain: fscanf: %s\n",
safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED;
@@ -1718,7 +1718,7 @@ DEFUN (pce_neigbhor,
if (!ospf_ri_enabled(vty))
return CMD_WARNING_CONFIG_FAILED;
- if (sscanf(argv[idx_number]->arg, "%d", &as) != 1) {
+ if (sscanf(argv[idx_number]->arg, "%" SCNu32, &as) != 1) {
vty_out(vty, "pce_neighbor: fscanf: %s\n",
safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED;
@@ -1754,7 +1754,7 @@ DEFUN (no_pce_neighbor,
uint32_t as;
struct ospf_pce_info *pce = &OspfRI.pce_info;
- if (sscanf(argv[idx_number]->arg, "%d", &as) != 1) {
+ if (sscanf(argv[idx_number]->arg, "%" SCNu32, &as) != 1) {
vty_out(vty, "no_pce_neighbor: fscanf: %s\n",
safe_strerror(errno));
return CMD_WARNING_CONFIG_FAILED;
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index cb384bfe1d..a58dfcdd5f 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -202,7 +202,7 @@ static int pim_zebra_if_state_up(int command, struct zclient *zclient,
* If we have a pimreg device callback and it's for a specific
* table set the master appropriately
*/
- if (sscanf(ifp->name, "pimreg%d", &table_id) == 1) {
+ if (sscanf(ifp->name, "pimreg%" SCNu32, &table_id) == 1) {
struct vrf *vrf;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((table_id == vrf->data.l.table_id)