diff options
author | Stephen Worley <sworley@cumulusnetworks.com> | 2020-07-29 19:11:37 +0200 |
---|---|---|
committer | Stephen Worley <sworley@cumulusnetworks.com> | 2020-09-28 18:41:00 +0200 |
commit | 73937edb73465713c1994202624ec85a306f4e45 (patch) | |
tree | 57099f9356f10b5fd64c0cb89404b08ee81680dc /sharpd | |
parent | lib,zebra,sharpd: clang format (diff) | |
download | frr-73937edb73465713c1994202624ec85a306f4e45.tar.xz frr-73937edb73465713c1994202624ec85a306f4e45.zip |
zebra,sharpd: checkpatch fixes
Check patches fixes for NHG API pathes.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'sharpd')
-rw-r--r-- | sharpd/sharp_nht.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sharpd/sharp_nht.c b/sharpd/sharp_nht.c index 38de8f217..9f3155272 100644 --- a/sharpd/sharp_nht.c +++ b/sharpd/sharp_nht.c @@ -123,10 +123,9 @@ static void sharp_nhgroup_add_cb(const char *name) snhg = XCALLOC(MTYPE_NHG, sizeof(*snhg)); snhg->id = sharp_get_next_nhid(); - strncpy(snhg->name, name, sizeof(snhg->name)); + strlcpy(snhg->name, name, sizeof(snhg->name)); sharp_nhg_rb_add(&nhg_head, snhg); - return; } static void sharp_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc, @@ -135,11 +134,10 @@ static void sharp_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc, struct sharp_nhg lookup; struct sharp_nhg *snhg; - strncpy(lookup.name, nhgc->name, sizeof(lookup.name)); + strlcpy(lookup.name, nhgc->name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); nhg_add(snhg->id, &nhgc->nhg); - return; } static void sharp_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc, @@ -148,11 +146,10 @@ static void sharp_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc, struct sharp_nhg lookup; struct sharp_nhg *snhg; - strncpy(lookup.name, nhgc->name, sizeof(lookup.name)); + strlcpy(lookup.name, nhgc->name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); nhg_add(snhg->id, &nhgc->nhg); - return; } static void sharp_nhgroup_delete_cb(const char *name) @@ -160,7 +157,7 @@ static void sharp_nhgroup_delete_cb(const char *name) struct sharp_nhg lookup; struct sharp_nhg *snhg; - strncpy(lookup.name, name, sizeof(lookup.name)); + strlcpy(lookup.name, name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); if (!snhg) return; @@ -168,7 +165,6 @@ static void sharp_nhgroup_delete_cb(const char *name) nhg_del(snhg->id); sharp_nhg_rb_del(&nhg_head, snhg); XFREE(MTYPE_NHG, snhg); - return; } uint32_t sharp_nhgroup_get_id(const char *name) @@ -176,7 +172,7 @@ uint32_t sharp_nhgroup_get_id(const char *name) struct sharp_nhg lookup; struct sharp_nhg *snhg; - strncpy(lookup.name, name, sizeof(lookup.name)); + strlcpy(lookup.name, name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); if (!snhg) return 0; |