aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_authenticate.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 17:27:02 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 17:27:02 +0000
commitb38bb3ca191bbeb92ddc4d190b1899cd7096292f (patch)
tree4195636f0b3bfef67f6a9146c65be153df504524 /apps/app_authenticate.c
parentbda31f54440215d62b9cca92498ce390262638c8 (diff)
off by one error
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101820 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_authenticate.c')
-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 c7a061829..b6ccffce5 100644
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -170,8 +170,8 @@ static int auth_exec(struct ast_channel *chan, void *data)
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)