summaryrefslogtreecommitdiff
path: root/src/libimcv/imv/imv_reason_string.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2014-03-11 20:48:48 +0100
committerYves-Alexis Perez <corsac@debian.org>2014-03-11 20:48:48 +0100
commit15fb7904f4431a6e7c305fd08732458f7f885e7e (patch)
treec93b60ee813af70509f00f34e29ebec311762427 /src/libimcv/imv/imv_reason_string.c
parent5313d2d78ca150515f7f5eb39801c100690b6b29 (diff)
downloadvyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.tar.gz
vyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.zip
Imported Upstream version 5.1.2
Diffstat (limited to 'src/libimcv/imv/imv_reason_string.c')
-rw-r--r--src/libimcv/imv/imv_reason_string.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libimcv/imv/imv_reason_string.c b/src/libimcv/imv/imv_reason_string.c
index d1447ec35..c09b7bdba 100644
--- a/src/libimcv/imv/imv_reason_string.c
+++ b/src/libimcv/imv/imv_reason_string.c
@@ -35,6 +35,11 @@ struct private_imv_reason_string_t {
char *lang;
/**
+ * Separator concatenating multiple reasons
+ */
+ char *separator;
+
+ /**
* Contains the concatenated reasons
*/
chunk_t reasons;
@@ -51,7 +56,8 @@ METHOD(imv_reason_string_t, add_reason, void,
if (this->reasons.len)
{
/* append any further reasons */
- this->reasons = chunk_cat("mcc", this->reasons, chunk_from_chars('\n'),
+ this->reasons = chunk_cat("mcc", this->reasons,
+ chunk_from_str(this->separator),
chunk_create(s_reason, strlen(s_reason)));
}
else
@@ -77,7 +83,7 @@ METHOD(imv_reason_string_t, destroy, void,
/**
* Described in header.
*/
-imv_reason_string_t *imv_reason_string_create(char *lang)
+imv_reason_string_t *imv_reason_string_create(char *lang, char *separator)
{
private_imv_reason_string_t *this;
@@ -88,6 +94,7 @@ imv_reason_string_t *imv_reason_string_create(char *lang)
.destroy = _destroy,
},
.lang = lang,
+ .separator = separator,
);
return &this->public;