summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index e18dfaceae2..5d89aa0f46b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5548,10 +5548,9 @@ glusterd_get_state(rpcsvc_request_t *req, dict_t *dict)
gf_asprintf(&filename, "%s", tmp_str);
}
- if (odir[odirlen - 1] != '/')
- strcat(odir, "/");
+ ret = gf_asprintf(&ofilepath, "%s%s%s", odir,
+ ((odir[odirlen - 1] != '/') ? "/" : ""), filename);
- ret = gf_asprintf(&ofilepath, "%s%s", odir, filename);
if (ret < 0) {
GF_FREE(odir);
GF_FREE(filename);