From b2b6ab8eff317f6a507ab23897ea6cd5c718d99a Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 2 Aug 2018 16:02:33 +0300 Subject: All: remove memset() before sprintf() It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/cluster/dht/src/dht-common.c | 2 +- xlators/cluster/dht/src/dht-helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 1d6564cb96..afec188907 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4322,7 +4322,7 @@ fill_layout_info (dht_layout_t *layout, char *buf) char tmp_buf[128] = {0,}; for (i = 0; i < layout->cnt; i++) { - snprintf (tmp_buf, 128, "(%s %u %u)", + snprintf (tmp_buf, sizeof (tmp_buf), "(%s %u %u)", layout->list[i].xlator->name, layout->list[i].start, layout->list[i].stop); diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 561d1199e1..20f1cccb25 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -631,7 +631,7 @@ dht_filter_loc_subvol_key (xlator_t *this, loc_t *loc, loc_t *new_loc, trav = this->children; while (trav) { - snprintf (key, 1024, "*@%s:%s", this->name, trav->xlator->name); + snprintf (key, sizeof (key), "*@%s:%s", this->name, trav->xlator->name); if (fnmatch (key, loc->name, FNM_NOESCAPE) == 0) { new_name = GF_CALLOC(strlen (loc->name), sizeof (char), -- cgit