[Asterisk-code-review] pbx spool: Gracefully handle long lines in call files (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Mon Mar 6 15:01:21 CST 2017
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/5125 )
Change subject: pbx_spool: Gracefully handle long lines in call files
......................................................................
Patch Set 1: Code-Review-1
(5 comments)
https://gerrit.asterisk.org/#/c/5125/1/pbx/pbx_spool.c
File pbx/pbx_spool.c:
Line 168: char *c;
Optional: The c2 var is used in a couple places. You don't need to move the declaration to each place.
char *c2;
PS1, Line 174: if ((c == line) || (*(c-1) == ' ') || (*(c-1) == '\t'))
: *c = '\0';
Adding curlies and break out of loop will avoid doing strchr again.
PS1, Line 182: if ((c > line) && (c[-1] == '\\')) {
: memmove(c - 1, c, strlen(c) + 1);
: c++;
Existing bug: Remove the c++.
Then "blah\;;comment" will be parsed correctly.
Line 272: struct ast_variable **tail = &o->vars;
Should always put a blank line after a variable declaration to make it easier to find them.
Line 313: ast_log(LOG_WARNING, "Skipping extremely long line %d of %s\n", lineno, o->fn);
"Skipping extremely long line at line %d of %s\n"
--
To view, visit https://gerrit.asterisk.org/5125
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I51bcf270c1b4347ba05b43f18dc2094c76f5d7b0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list