summaryrefslogtreecommitdiff
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2005-07-10 23:21:39 +0000
committerRussell Bryant <russell@russellbryant.com>2005-07-10 23:21:39 +0000
commitc18fd5cd8c1b6e582915d920d0831441505c30fc (patch)
treecd22ca2f4e2c7b9edcb1c3ee5c724068bae3bc36 /res/res_agi.c
parent206f712599e504d8b20ff48663e130a9726f8896 (diff)
more ast_copy_string conversions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_agi.c')
-rwxr-xr-xres/res_agi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 9ae23dca3..611b92cf4 100755
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -757,7 +757,7 @@ static int handle_setcontext(struct ast_channel *chan, AGI *agi, int argc, char
if (argc != 3)
return RESULT_SHOWUSAGE;
- strncpy(chan->context, argv[2], sizeof(chan->context)-1);
+ ast_copy_string(chan->context, argv[2], sizeof(chan->context));
fdprintf(agi->fd, "200 result=0\n");
return RESULT_SUCCESS;
}
@@ -766,7 +766,7 @@ static int handle_setextension(struct ast_channel *chan, AGI *agi, int argc, cha
{
if (argc != 3)
return RESULT_SHOWUSAGE;
- strncpy(chan->exten, argv[2], sizeof(chan->exten)-1);
+ ast_copy_string(chan->exten, argv[2], sizeof(chan->exten));
fdprintf(agi->fd, "200 result=0\n");
return RESULT_SUCCESS;
}
@@ -1028,7 +1028,7 @@ static int handle_setcallerid(struct ast_channel *chan, AGI *agi, int argc, char
char *l = NULL, *n = NULL;
if (argv[2]) {
- strncpy(tmp, argv[2], sizeof(tmp) - 1);
+ ast_copy_string(tmp, argv[2], sizeof(tmp));
ast_callerid_parse(tmp, &n, &l);
if (l)
ast_shrink_phone_number(l);
@@ -1925,7 +1925,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
ast_log(LOG_WARNING, "AGI requires an argument (script)\n");
return -1;
}
- strncpy(buf, data, sizeof(buf) - 1);
+ ast_copy_string(buf, data, sizeof(buf));
memset(&agi, 0, sizeof(agi));
while ((stringp = strsep(&tmp, "|"))) {