diff options
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index f47e45db6..451c7b1f8 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -71,8 +71,12 @@ static int function_fieldqty(struct ast_channel *chan, const 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; } |