aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_strings.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index e1808604b..3c8ead803 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -59,8 +59,12 @@ static int function_fieldqty(struct ast_channel *chan, char *cmd,
sprintf(varsubst, "${%s}", args.varname);
pbx_substitute_variables_helper(chan, varsubst, varval, sizeof(varval) - 1);
- while (strsep(&varval2, args.delim))
- fieldcount++;
+ if (ast_strlen_zero(varval2))
+ fieldcount = 0;
+ else {
+ while (strsep(&varval2, args.delim))
+ fieldcount++;
+ }
} else {
fieldcount = 1;
}