summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-common.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-08-28 19:38:01 +0300
committerKotresh HR <khiremat@redhat.com>2019-09-05 08:57:12 +0000
commitf6d6c0f65f7b512724694b3436358e1113cbfccb (patch)
tree7b04c3c1391bbbbb6bc87f9d0b94caff430ed089 /xlators/storage/posix/src/posix-common.c
parentee24c0438ce40b0c6faf6581fd4eb162767d8a90 (diff)
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 <ykaul@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-common.c')
-rw-r--r--xlators/storage/posix/src/posix-common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index eee39fd..231723b 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) {