diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-10 23:12:25 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-10 23:12:25 +0000 |
commit | d99da55a16b32f4463c40d504fa2ffee4ba8966d (patch) | |
tree | a725ca8f608e13f6dda4ebce3d55d8abafb9317a /apps/app_directory.c | |
parent | 9690f518f5b644b670f4e8e047083535c106dafa (diff) |
more ast_copy_string conversions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6074 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-x | apps/app_directory.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c index 1e451ee2e..252b43787 100755 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -183,9 +183,9 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia /* Name selected */ loop = 0; if (ast_exists_extension(chan,dialcontext,ext,1,chan->cid.cid_num)) { - strncpy(chan->exten, ext, sizeof(chan->exten)-1); + ast_copy_string(chan->exten, ext, sizeof(chan->exten)); chan->priority = 0; - strncpy(chan->context, dialcontext, sizeof(chan->context)-1); + ast_copy_string(chan->context, dialcontext, sizeof(chan->context)); } else { ast_log(LOG_WARNING, "Can't find extension '%s' in context '%s'. " @@ -296,7 +296,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * if (ast_exists_extension(chan,chan->context,"o",1,chan->cid.cid_num) || (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num))) { - strncpy(chan->exten, "o", sizeof(chan->exten)-1); + strcpy(chan->exten, "o"); chan->priority = 0; return 0; } else { @@ -310,7 +310,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * if (ast_exists_extension(chan,chan->context,"a",1,chan->cid.cid_num) || (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->cid.cid_num))) { - strncpy(chan->exten, "a", sizeof(chan->exten)-1); + strcpy(chan->exten, "a"); chan->priority = 0; return 0; } else { @@ -337,7 +337,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * strsep(&stringp, ","); pos = strsep(&stringp, ","); if (pos) { - strncpy(name, pos, sizeof(name) - 1); + ast_copy_string(name, pos, sizeof(name)); /* Grab the last name */ if (last && strrchr(pos,' ')) pos = strrchr(pos, ' ') + 1; @@ -371,8 +371,8 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * case '1': /* user pressed '1' and extensions exists */ lastuserchoice = res; - strncpy(chan->context, dialcontext, sizeof(chan->context) - 1); - strncpy(chan->exten, v->name, sizeof(chan->exten) - 1); + ast_copy_string(chan->context, dialcontext, sizeof(chan->context)); + ast_copy_string(chan->exten, v->name, sizeof(chan->exten)); chan->priority = 0; break; case '*': |