From d6d729b0609957c0382749c30da507dda77561b7 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Tue, 21 Aug 2018 19:33:16 +0300 Subject: 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 --- xlators/features/index/src/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/features/index') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 86c21e9aa83..3a518248c13 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1081,7 +1081,7 @@ index_inode_path (xlator_t *this, inode_t *inode, char *dirpath, size_t len) } make_index_dir_path (priv->index_basepath, ENTRY_CHANGES_SUBDIR, dirpath, len); - if (len <= strlen (dirpath) + 1 /*'/'*/ + strlen (UUID0_STR)) { + if (len <= strlen (dirpath) + 1 /*'/'*/ + SLEN (UUID0_STR)) { ret = -EINVAL; goto out; } -- cgit