diff options
author | Terry Wilson <twilson@digium.com> | 2012-04-19 19:05:17 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-04-19 19:05:17 +0000 |
commit | 6d6bacd5cbf255605bb463d4985c331db6cb89aa (patch) | |
tree | 04001719167f1209976cb8ee3c9d8374d1c35dc4 /channels/iax2-provision.c | |
parent | ba93541cedf29837f8fe485ebb3a5a2c06499693 (diff) |
Convert some strncpys to ast_copy_string
Review: https://reviewboard.asterisk.org/r/1732/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/iax2-provision.c')
-rw-r--r-- | channels/iax2-provision.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c index 26c7a0b5d..03b042b10 100644 --- a/channels/iax2-provision.c +++ b/channels/iax2-provision.c @@ -311,7 +311,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, ast_mutex_unlock(&provlock); } if (def) - strncpy(cur->src, def, sizeof(cur->src) - 1); + ast_copy_string(cur->src, def, sizeof(cur->src)); else cur->src[0] = '\0'; v = ast_variable_browse(cfg, s); @@ -347,15 +347,15 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, if (ast_str2tos(v->value, &cur->tos)) ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno); } else if (!strcasecmp(v->name, "user")) { - strncpy(cur->user, v->value, sizeof(cur->user) - 1); + ast_copy_string(cur->user, v->value, sizeof(cur->user)); if (strcmp(cur->user, v->value)) ast_log(LOG_WARNING, "Truncating username from '%s' to '%s' for '%s' at line %d\n", v->value, cur->user, s, v->lineno); } else if (!strcasecmp(v->name, "pass")) { - strncpy(cur->pass, v->value, sizeof(cur->pass) - 1); + ast_copy_string(cur->pass, v->value, sizeof(cur->pass)); if (strcmp(cur->pass, v->value)) ast_log(LOG_WARNING, "Truncating password from '%s' to '%s' for '%s' at line %d\n", v->value, cur->pass, s, v->lineno); } else if (!strcasecmp(v->name, "language")) { - strncpy(cur->lang, v->value, sizeof(cur->lang) - 1); + ast_copy_string(cur->lang, v->value, sizeof(cur->lang)); if (strcmp(cur->lang, v->value)) ast_log(LOG_WARNING, "Truncating language from '%s' to '%s' for '%s' at line %d\n", v->value, cur->lang, s, v->lineno); } else if (!strcasecmp(v->name, "flags")) { @@ -391,7 +391,7 @@ static int iax_process_template(struct ast_config *cfg, char *s, char *def) return -1; } /* Initialize entry */ - strncpy(cur->name, s, sizeof(cur->name) - 1); + ast_copy_string(cur->name, s, sizeof(cur->name)); cur->dead = 1; } if (!iax_template_parse(cur, cfg, s, def)) |