diff options
author | Amar Tumballi <amar@gluster.com> | 2010-07-02 12:48:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-06 05:58:37 -0700 |
commit | a45ac57e4e12a32f7136f22c2eb0519fbd61354c (patch) | |
tree | 47396d25b22f3b7713afae250fedb1747256b1fa /glusterfsd | |
parent | 3ec73cb88e8a302e973f8d1a68bcaf3981512b20 (diff) |
allocate space for '\0' in string, while adding xlator-option
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1044 ('--xlator-option' is not working)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1044
Diffstat (limited to 'glusterfsd')
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 01d155a2d4b..13217836c90 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -348,7 +348,7 @@ gf_remember_xlator_option (struct list_head *options, char *arg) if (!dot) goto out; - option->volume = GF_CALLOC ((dot - arg), sizeof (char), + option->volume = GF_CALLOC ((dot - arg) + 1, sizeof (char), gfd_mt_char); strncpy (option->volume, arg, (dot - arg)); @@ -356,7 +356,7 @@ gf_remember_xlator_option (struct list_head *options, char *arg) if (!equals) goto out; - option->key = GF_CALLOC ((equals - dot), sizeof (char), + option->key = GF_CALLOC ((equals - dot) + 1, sizeof (char), gfd_mt_char); strncpy (option->key, dot + 1, (equals - dot - 1)); |