diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-05 16:32:16 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-05 16:32:16 +0000 |
commit | 2dd14b8c0e865f214f00ada06612d3e7cb4928e6 (patch) | |
tree | 1d36c89b23d1c07dd7adc9a1dbe08b4882358c96 /app.c | |
parent | ad9520e6b0bee1ace5d48ed81659581d63e97d10 (diff) |
more ast_copy_string() conversion
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5849 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-x | app.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -384,7 +384,7 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, in return -1; autoclose = 1; if (filename[0] == '/') - strncpy(tmpf, filename, sizeof(tmpf) - 1); + ast_copy_string(tmpf, filename, sizeof(tmpf)); else snprintf(tmpf, sizeof(tmpf), "%s/%s/%s", (char *)ast_config_AST_VAR_DIR, "sounds", filename); fd = open(tmpf, O_RDONLY); @@ -773,7 +773,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf if (d < 0) return -1; } - strncpy(prependfile, recordfile, sizeof(prependfile) -1); + ast_copy_string(prependfile, recordfile, sizeof(prependfile)); strncat(prependfile, "-prepend", sizeof(prependfile) - strlen(prependfile) - 1); fmts = ast_strdupa(fmt); @@ -971,7 +971,7 @@ int ast_app_group_split_group(char *data, char *group, int group_max, char *cate char *grp=NULL, *cat=NULL; if (data && !ast_strlen_zero(data)) { - strncpy(tmp, data, sizeof(tmp) - 1); + ast_copy_string(tmp, data, sizeof(tmp)); grp = tmp; cat = strchr(tmp, '@'); if (cat) { @@ -981,14 +981,14 @@ int ast_app_group_split_group(char *data, char *group, int group_max, char *cate } if (grp && !ast_strlen_zero(grp)) - strncpy(group, grp, group_max -1); + ast_copy_string(group, grp, group_max); else res = -1; if (cat) snprintf(category, category_max, "%s_%s", GROUP_CATEGORY_PREFIX, cat); else - strncpy(category, GROUP_CATEGORY_PREFIX, category_max - 1); + ast_copy_string(category, GROUP_CATEGORY_PREFIX, category_max); return res; } @@ -1015,9 +1015,9 @@ int ast_app_group_get_count(char *group, char *category) char cat[80] = ""; if (category && !ast_strlen_zero(category)) { - strncpy(cat, category, sizeof(cat) - 1); + ast_copy_string(cat, category, sizeof(cat)); } else { - strncpy(cat, GROUP_CATEGORY_PREFIX, sizeof(cat) - 1); + ast_copy_string(cat, GROUP_CATEGORY_PREFIX, sizeof(cat)); } if (group && !ast_strlen_zero(group)) { @@ -1050,9 +1050,9 @@ int ast_app_group_match_get_count(char *groupmatch, char *category) return 0; if (category && !ast_strlen_zero(category)) { - strncpy(cat, category, sizeof(cat) - 1); + ast_copy_string(cat, category, sizeof(cat)); } else { - strncpy(cat, GROUP_CATEGORY_PREFIX, sizeof(cat) - 1); + ast_copy_string(cat, GROUP_CATEGORY_PREFIX, sizeof(cat)); } chan = ast_channel_walk_locked(NULL); |