diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-25 14:44:50 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-25 14:44:50 +0000 |
commit | 470f688a28975e63c0df4ffdb8a0ac490f4cf3d9 (patch) | |
tree | a306715b687622ba9fa6548dc30e79f9c1e1b057 /pbx/pbx_spool.c | |
parent | 6b11ab9b13141b94402e953c33feebcc2e81f542 (diff) |
Merged revisions 46200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r46200 | kpfleming | 2006-10-25 09:32:08 -0500 (Wed, 25 Oct 2006) | 2 lines
apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46201 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_spool.c')
-rw-r--r-- | pbx/pbx_spool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index ec008280b..d9b0eac6a 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -166,11 +166,11 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) printf("'%s' is '%s' at line %d\n", buf, c, lineno); #endif if (!strcasecmp(buf, "channel")) { - strncpy(o->tech, c, sizeof(o->tech) - 1); + ast_copy_string(o->tech, c, sizeof(o->tech)); if ((c2 = strchr(o->tech, '/'))) { *c2 = '\0'; c2++; - strncpy(o->dest, c2, sizeof(o->dest) - 1); + ast_copy_string(o->dest, c2, sizeof(o->dest)); } else { ast_log(LOG_NOTICE, "Channel should be in form Tech/Dest at line %d of %s\n", lineno, fn); o->tech[0] = '\0'; @@ -178,18 +178,18 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) } else if (!strcasecmp(buf, "callerid")) { ast_callerid_split(c, o->cid_name, sizeof(o->cid_name), o->cid_num, sizeof(o->cid_num)); } else if (!strcasecmp(buf, "application")) { - strncpy(o->app, c, sizeof(o->app) - 1); + ast_copy_string(o->app, c, sizeof(o->app)); } else if (!strcasecmp(buf, "data")) { - strncpy(o->data, c, sizeof(o->data) - 1); + ast_copy_string(o->data, c, sizeof(o->data)); } else if (!strcasecmp(buf, "maxretries")) { if (sscanf(c, "%d", &o->maxretries) != 1) { ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn); o->maxretries = 0; } } else if (!strcasecmp(buf, "context")) { - strncpy(o->context, c, sizeof(o->context) - 1); + ast_copy_string(o->context, c, sizeof(o->context)); } else if (!strcasecmp(buf, "extension")) { - strncpy(o->exten, c, sizeof(o->exten) - 1); + ast_copy_string(o->exten, c, sizeof(o->exten)); } else if (!strcasecmp(buf, "priority")) { if ((sscanf(c, "%d", &o->priority) != 1) || (o->priority < 1)) { ast_log(LOG_WARNING, "Invalid priority at line %d of %s\n", lineno, fn); @@ -240,7 +240,7 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn); } } - strncpy(o->fn, fn, sizeof(o->fn) - 1); + ast_copy_string(o->fn, fn, sizeof(o->fn)); if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) { ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn); return -1; |