diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-18 02:00:34 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-18 02:00:34 +0000 |
commit | 79caed98062c0c29c1f6bb8f31e2b22f51f1fca7 (patch) | |
tree | 7006f57f2b20e67260ab6427fd3a3035d56ee922 /funcs/func_strings.c | |
parent | e9ff0e580aaeb8799ff153fea6b76cdf1f5df343 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@8172 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-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 91564d9e4..503611bbe 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -48,8 +48,12 @@ static char *function_fieldqty(struct ast_channel *chan, char *cmd, char *data, if (delim) { varname = strsep(&delim, "|"); pbx_retrieve_variable(chan, varname, &varval, workspace, sizeof(workspace), NULL); - while (strsep(&varval, delim)) - fieldcount++; + if (delim) { + while (strsep(&varval, delim)) + fieldcount++; + } else if (!ast_strlen_zero(varval)) { + fieldcount = 1; + } snprintf(buf, len, "%d", fieldcount); } else { ast_log(LOG_ERROR, "Out of memory\n"); |