Skip to content
Snippets Groups Projects
Commit 3da361ee authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

optimize file reading in pbx_spool (bug #3927)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c4ca6bf4
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,8 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
char buf[256];
char *c, *c2;
int lineno = 0;
while(!feof(f)) {
fgets(buf, sizeof(buf), f);
while(fgets(buf, sizeof(buf), f)) {
lineno++;
if (!ast_strlen_zero(buf)) {
/* Trim comments */
c = buf;
while ((c = strchr(c, '#'))) {
......@@ -186,7 +184,6 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
} else
ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
}
}
}
strncpy(o->fn, fn, sizeof(o->fn) - 1);
if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment