From: Jason Parker Date: Fri, 1 Feb 2008 17:44:32 +0000 (+0000) Subject: Move an feof() call to before the fgets(). X-Git-Tag: 1.6.0-beta3~2^2~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03a95a20db97674ed999f18204062a8f3abfd40b;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@101823 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c index 408de55f88..d700741bf5 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;