aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 17:44:32 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 17:44:32 +0000
commitdadc6549d2812a91a7d561e9fb0995824c802a99 (patch)
tree216bb5f02abba9a6ffeaaf893408b8dfec380cd8 /apps
parent182526675bb5718d9e91df755289c12ec70a0595 (diff)
Move an feof() call to before the fgets().
This would have exited the loop early if you had an authentication file with no newline at the end. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@101823 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_authenticate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index 408de55f8..d700741bf 100644
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -150,11 +150,11 @@ static int auth_exec(struct ast_channel *chan, void *data)
for (;;) {
size_t len;
- fgets(buf, sizeof(buf), f);
-
if (feof(f))
break;
+ fgets(buf, sizeof(buf), f);
+
if (ast_strlen_zero(buf))
continue;