summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/config.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/config.c b/main/config.c
index 10ac18e28..041f1bca2 100644
--- a/main/config.c
+++ b/main/config.c
@@ -125,8 +125,10 @@ static void CB_ADD(struct ast_str **cb, const char *str)
static void CB_ADD_LEN(struct ast_str **cb, const char *str, int len)
{
char *s = ast_alloca(len + 1);
- ast_copy_string(s, str, len);
- ast_str_append(cb, 0, "%s", str);
+
+ memcpy(s, str, len);
+ s[len] = '\0';
+ ast_str_append(cb, 0, "%s", s);
}
static void CB_RESET(struct ast_str *cb, struct ast_str *llb)
@@ -1839,7 +1841,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
} else if ((comment_p >= new_buf + 2) &&
(*(comment_p - 1) == COMMENT_TAG) &&
(*(comment_p - 2) == COMMENT_TAG)) {
- /* Meta-Comment end detected */
+ /* Meta-Comment end detected "--;" */
comment--;
new_buf = comment_p + 1;
if (!comment) {