diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-04-01 21:31:12 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-04-01 21:31:12 +0000 |
commit | 91ab9652d3d72a772db69fd72ad5e38d5a960d0d (patch) | |
tree | a29718d773c78d4dd62808a24218c19a95b0af07 /pbx | |
parent | 12f10b7db375385f1a52a37404b7dd5f4d3d108e (diff) |
optimize file reading in pbx_spool (bug #3927)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5351 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_spool.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index 865c0ad04..0abf97042 100755 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -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))) { |