[asterisk-bugs] [JIRA] (ASTERISK-23546) CB_ADD_LEN does not do what you'd think

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Tue Apr 8 15:28:19 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=217095#comment-217095 ] 

Richard Mudgett commented on ASTERISK-23546:
--------------------------------------------

No one has noticed this bug because I don't think there are many people using (or even know about) the ;-- --; style comment blocks.  This code is only executed when the comments are being saved and the block comment starts and ends within the same line like this:
{noformat}
exten => 1000,;-- Comment --;1,NoOp()
{noformat}

The example above requires the CB_ADD_LEN() code to save the comment portion correctly and not the CB_ADD() behaviour bug.

> CB_ADD_LEN does not do what you'd think
> ---------------------------------------
>
>                 Key: ASTERISK-23546
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23546
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Configuration, Core/General
>    Affects Versions: SVN, 1.8.26.1
>            Reporter: Walter Doekes
>            Assignee: Walter Doekes
>            Severity: Trivial
>
> What's wrong with this code? ;)
> {code}
> 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);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list