From 58cf35b353f5a9fedfddd6da2f5811c58f1be3cc Mon Sep 17 00:00:00 2001 From: Gaurav Date: Thu, 7 Apr 2011 01:42:33 +0000 Subject: CLI : Display possible options in proper format. Signed-off-by: Gaurav Signed-off-by: Anand Avati BUG: 2598 (Volume access option suceeds with any string value) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2598 --- libglusterfs/src/xlator.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index f35c2518346..9b91729ecae 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -334,9 +334,13 @@ _volume_option_value_validate_attacherr (xlator_t *xl, */ char given_array[4096] = {0,}; for (i = 0; (i < ZR_OPTION_MAX_ARRAY_SIZE) && - opt->value[i]; i++) { + opt->value[i];) { strcat (given_array, opt->value[i]); - strcat (given_array, ", "); + if(((++i) < ZR_OPTION_MAX_ARRAY_SIZE) && + (opt->value[i])) + strcat (given_array, ", "); + else + strcat (given_array, "."); } gf_log (xl->name, GF_LOG_ERROR, @@ -819,9 +823,13 @@ _volume_option_value_validate (xlator_t *xl, */ char given_array[4096] = {0,}; for (i = 0; (i < ZR_OPTION_MAX_ARRAY_SIZE) && - opt->value[i]; i++) { + opt->value[i];) { strcat (given_array, opt->value[i]); - strcat (given_array, ", "); + if(((++i) < ZR_OPTION_MAX_ARRAY_SIZE) && + (opt->value[i])) + strcat (given_array, ", "); + else + strcat (given_array, "."); } gf_log (xl->name, GF_LOG_ERROR, -- cgit