]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Move an feof() call to before the fgets().
authorJason Parker <jparker@digium.com>
Fri, 1 Feb 2008 17:44:32 +0000 (17:44 +0000)
committerJason Parker <jparker@digium.com>
Fri, 1 Feb 2008 17:44:32 +0000 (17:44 +0000)
This would have exited the loop early if you had an authentication file with no newline at the end.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101823 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_authenticate.c

index 408de55f88d85df919e0089fb044a08938b9eba3..d700741bf58afb06e0001c22cb8c7aea0e326bfa 100644 (file)
@@ -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;