aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapp.c2
-rwxr-xr-xapps/app_read.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/app.c b/app.c
index 86ad5077c..401b4451a 100755
--- a/app.c
+++ b/app.c
@@ -37,6 +37,8 @@ int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, in
{
int res,to,fto;
/* XXX Merge with full version? XXX */
+ if (maxlen)
+ s[0] = '\0';
if (prompt) {
res = ast_streamfile(c, prompt, c->language);
if (res < 0)
diff --git a/apps/app_read.c b/apps/app_read.c
index 103e85710..988ef8009 100755
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -103,9 +103,12 @@ static int read_exec(struct ast_channel *chan, void *data)
if (!res) {
ast_stopstream(chan);
res = ast_app_getdata(chan, filename, tmp, maxdigits, 0);
- if (res > -1)
+ if (res > -1) {
pbx_builtin_setvar_helper(chan, varname, tmp);
- ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
+ ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
+ } else {
+ ast_verbose(VERBOSE_PREFIX_3 "User entered nothing\n");
+ }
}
LOCAL_USER_REMOVE(u);
return res;