diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 19:33:16 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-31 02:14:06 +0000 |
commit | d6d729b0609957c0382749c30da507dda77561b7 (patch) | |
tree | f267deebe2735e1aed4890b31f2e894a04221b58 /xlators/mgmt/glusterd/src/glusterd-locks.c | |
parent | 437455c1608a0c644d14798551c77e9513ba9901 (diff) |
xlators: move from strlen() to sizeof()
xlators/features/index/src/index.c
xlators/features/shard/src/shard.c
xlators/features/upcall/src/upcall-internal.c
xlators/mgmt/glusterd/src/glusterd-bitrot.c
xlators/mgmt/glusterd/src/glusterd-locks.c
xlators/mgmt/glusterd/src/glusterd-mountbroker.c
xlators/mgmt/glusterd/src/glusterd-op-sm.c
For const strings, just do compile time size calc instead of runtime.
Compile-tested only!
Change-Id: I995b2b89f14454b3855a4cd0ca90b3f01d5e080f
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-locks.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-locks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c index 1e99117b3a1..f9b0409b60d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-locks.c +++ b/xlators/mgmt/glusterd/src/glusterd-locks.c @@ -740,7 +740,7 @@ gd_mgmt_v3_unlock_timer_cbk (void *data) ret = snprintf (bt_key, PATH_MAX, "debug.last-success-bt-%s-%s", name, type + 1); - if (ret != strlen ("debug.last-success-bt-") + strlen (name) + + if (ret != SLEN ("debug.last-success-bt-") + strlen (name) + strlen (type)) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_CREATE_KEY_FAIL, "Unable to create backtrace " @@ -875,7 +875,7 @@ glusterd_mgmt_v3_unlock (const char *name, uuid_t uuid, char *type) /* Remove the backtrace key as well */ ret = snprintf (key, sizeof(key), "debug.last-success-bt-%s-%s", name, type); - if (ret != strlen ("debug.last-success-bt-") + strlen (name) + + if (ret != SLEN ("debug.last-success-bt-") + strlen (name) + strlen (type) + 1) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_CREATE_KEY_FAIL, "Unable to create backtrace " |