aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_groupcount.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_groupcount.c')
-rw-r--r--apps/app_groupcount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c
index 07c07835c..e44451370 100644
--- a/apps/app_groupcount.c
+++ b/apps/app_groupcount.c
@@ -70,7 +70,8 @@ static int group_count_exec(struct ast_channel *chan, void *data)
if (ast_strlen_zero(group)) {
grp = pbx_builtin_getvar_helper(chan, category);
- strncpy(group, grp, sizeof(group) - 1);
+ if (!ast_strlen_zero(grp))
+ ast_copy_string(group, grp, sizeof(group));
}
count = ast_app_group_get_count(group, category);