[asterisk-commits] russell: branch 1.4 r101820 - /branches/1.4/apps/app_authenticate.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 1 11:27:02 CST 2008


Author: russell
Date: Fri Feb  1 11:27:02 2008
New Revision: 101820

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101820
Log:
off by one error

Modified:
    branches/1.4/apps/app_authenticate.c

Modified: branches/1.4/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_authenticate.c?view=diff&rev=101820&r1=101819&r2=101820
==============================================================================
--- branches/1.4/apps/app_authenticate.c (original)
+++ branches/1.4/apps/app_authenticate.c Fri Feb  1 11:27:02 2008
@@ -170,8 +170,8 @@
 						fgets(buf, sizeof(buf), f);
 						if (!feof(f) && !ast_strlen_zero(buf)) {
 							size_t len = strlen(buf);
-							if (buf[len] == '\n')
-								buf[len] = '\0';
+							if (buf[len - 1] == '\n')
+								buf[len - 1] = '\0';
 							if (ast_test_flag(&flags,OPT_MULTIPLE)) {
 								md5secret = strchr(buf, ':');
 								if (md5secret == NULL)




More information about the asterisk-commits mailing list