From f6d6c0f65f7b512724694b3436358e1113cbfccb Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Wed, 28 Aug 2019 19:38:01 +0300 Subject: posix*.c: remove unneeded strlen() calls In various places, we can re-use knowledge of string length or result of snprintf() and such instead of strlen(). Change-Id: I4c9b1decf1169b3f8ac83699a0afbd7c38fad746 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/storage/posix/src/posix-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix-common.c') diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index eee39fd000f..231723b6bef 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -620,7 +620,7 @@ posix_init(xlator_t *this) } _private->base_path = gf_strdup(dir_data->data); - _private->base_path_length = strlen(_private->base_path); + _private->base_path_length = dir_data->len - 1; ret = dict_get_str(this->options, "hostname", &_private->hostname); if (ret) { -- cgit