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_macro.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_macro.c')
-rwxr-xr-x | apps/app_macro.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c index 25d2aa864..fb48edc21 100755 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -124,11 +124,11 @@ static int macro_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); /* Save old info */ oldpriority = chan->priority; - strncpy(oldexten, chan->exten, sizeof(oldexten) - 1); - strncpy(oldcontext, chan->context, sizeof(oldcontext) - 1); + ast_copy_string(oldexten, chan->exten, sizeof(oldexten)); + ast_copy_string(oldcontext, chan->context, sizeof(oldcontext)); if (ast_strlen_zero(chan->macrocontext)) { - strncpy(chan->macrocontext, chan->context, sizeof(chan->macrocontext) - 1); - strncpy(chan->macroexten, chan->exten, sizeof(chan->macroexten) - 1); + ast_copy_string(chan->macrocontext, chan->context, sizeof(chan->macrocontext)); + ast_copy_string(chan->macroexten, chan->exten, sizeof(chan->macroexten)); chan->macropriority = chan->priority; setmacrocontext=1; } @@ -158,7 +158,7 @@ static int macro_exec(struct ast_channel *chan, void *data) /* Setup environment for new run */ chan->exten[0] = 's'; chan->exten[1] = '\0'; - strncpy(chan->context, fullmacro, sizeof(chan->context) - 1); + ast_copy_string(chan->context, fullmacro, sizeof(chan->context)); chan->priority = 1; while((cur = strsep(&rest, "|")) && (argc < MAX_ARGS)) { @@ -246,10 +246,10 @@ static int macro_exec(struct ast_channel *chan, void *data) if (!strcasecmp(chan->context, fullmacro)) { /* If we're leaving the macro normally, restore original information */ chan->priority = oldpriority; - strncpy(chan->context, oldcontext, sizeof(chan->context) - 1); + ast_copy_string(chan->context, oldcontext, sizeof(chan->context)); if (!(chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO)) { /* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */ - strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1); + ast_copy_string(chan->exten, oldexten, sizeof(chan->exten)); if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) { /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue normally if there is any problem */ |