[svn-commits] rmudgett: branch 11 r411961 - in /branches/11: ./ main/config.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 8 15:50:50 CDT 2014


Author: rmudgett
Date: Tue Apr  8 15:50:45 2014
New Revision: 411961

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411961
Log:
config: Fix CB_ADD_LEN() to work as originally intended.

Fix a long standing bug in CB_ADD_LEN() behaving like CB_ADD().

ASTERISK-23546 #close
Reported by: Walter Doekes
........

Merged revisions 411960 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/config.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/config.c?view=diff&rev=411961&r1=411960&r2=411961
==============================================================================
--- branches/11/main/config.c (original)
+++ branches/11/main/config.c Tue Apr  8 15:50:45 2014
@@ -124,8 +124,10 @@
 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)
@@ -1785,7 +1787,7 @@
 					} 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) {




More information about the svn-commits mailing list