From f2c4538f612a8976c7cc8893000165fa06733ddb Mon Sep 17 00:00:00 2001 From: Matteo Brancaleoni Date: Fri, 7 Mar 2003 06:00:13 +0000 Subject: Fri Mar 7 07:00:00 CET 2003 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@634 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_disa.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps/app_disa.c') diff --git a/apps/app_disa.c b/apps/app_disa.c index 89d956deb..978336936 100755 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -251,7 +251,7 @@ static int disa_exec(struct ast_channel *chan, void *data) tmp[0] = 0; while(fgets(tmp,sizeof(tmp) - 1,fp)) { - char *stringp=NULL; + char *stringp=NULL,*stringp2; if (!tmp[0]) continue; if (tmp[strlen(tmp) - 1] == '\n') tmp[strlen(tmp) - 1] = 0; @@ -261,9 +261,12 @@ static int disa_exec(struct ast_channel *chan, void *data) if (tmp[0] == ';') continue; stringp=tmp; strsep(&stringp, "|"); - /* save 2nd arg as clid */ - ourcallerid = arg2; - ourcontext = strsep(&stringp, "|"); + stringp2=strsep(&stringp, "|"); + if (stringp2) { + ourcontext=stringp2; + stringp2=strsep(&stringp, "|"); + if (stringp2) ourcallerid=stringp2; + } /* password must be in valid format (numeric) */ if (sscanf(tmp,"%d",&j) < 1) continue; /* if we got it */ -- cgit v1.2.3