ensure account code is not overwritten when none is supplied (bug #4743)
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 19 Jul 2005 23:45:21 +0000 (23:45 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 19 Jul 2005 23:45:21 +0000 (23:45 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6168 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_disa.c

index 8b93463..9f69776 100755 (executable)
@@ -329,7 +329,9 @@ static int disa_exec(struct ast_channel *chan, void *data)
                }
                strncpy(chan->exten, exten, sizeof(chan->exten) - 1);
                strncpy(chan->context, ourcontext, sizeof(chan->context) - 1);
-               strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
+               if (!ast_strlen_zero(acctcode)) {
+                       strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
+               }
                chan->priority = 0;
                ast_cdr_reset(chan->cdr,AST_CDR_FLAG_POSTED);
                LOCAL_USER_REMOVE(u);