]> git.puffer.fish Git - mirror/frr.git/commitdiff
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio) 2603/head
authorF. Aragon <paco@voltanet.io>
Mon, 2 Jul 2018 15:32:05 +0000 (17:32 +0200)
committerF. Aragon <paco@voltanet.io>
Mon, 2 Jul 2018 15:50:21 +0000 (17:50 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
eigrpd/eigrp_hello.c
nhrpd/nhrp_event.c
ospfd/ospf_ri.c
pimd/pim_zebra.c

index d9e89357ca13ba0d92105a74338572cb528da3c5..2e55d57c3154984698350c1b3afe5c7d3e257407 100644 (file)
@@ -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);
index e7adc971e53f41c73a778d702a483c74ff02f6d7..7ca9731765d2d1c6691d0d869e2a1eb67f24ef85 100644 (file)
@@ -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;
index 93267156f2f9381b53d4c823d9ed73ff9598ca95..fa7dd04d19f800f6a48a408a7eb8fbb7330dff1a 100644 (file)
@@ -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;
index cb384bfe1da8d2dd021f2c18a44c91df73d3d459..a58dfcdd5f0e5bc85e34b5f66b336fa3a15d1e7e 100644 (file)
@@ -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)