aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-26 15:50:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-26 15:50:50 +0000
commit2c1f5ac39f63a78dbcf66a0e2b8aaaf734cb5dce (patch)
tree351903ef14a0ad8e6f8a787e97793d56016618d3 /pbx.c
parent1f389b40b0a726a9a7ba13059d3f753e64696e84 (diff)
fix return value for ExecIfTime when time is outside of the specified range (bug #4380)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5773 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbx.c b/pbx.c
index 803c3fca4..47a7cde60 100755
--- a/pbx.c
+++ b/pbx.c
@@ -5443,7 +5443,12 @@ static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
ptr2 = ptr1;
/* Separate the Application data ptr1 is the time spec ptr2 is the app|data*/
strsep(&ptr2,"?");
- if (ast_build_timing(&timing, ptr1) && ast_check_timing(&timing)) {
+ if(!(res = ast_build_timing(&timing, ptr1))) {
+ ast_log(LOG_WARNING, "Invalid Time Spec: %s\nCorrect usage: %s\n", ptr1, usage);
+ res = -1;
+ }
+
+ if (!res && ast_check_timing(&timing)) {
if (ptr2) {
/* ptr2 is now the app name
we're done with ptr1 now so recycle it and use it to point to the app args*/
@@ -5461,9 +5466,6 @@ static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
} else {
ast_log(LOG_WARNING, "%s\n", usage);
}
- } else {
- ast_log(LOG_WARNING, "Invalid Time Spec: %s\nCorrect usage: %s\n", ptr1, usage);
- res = -1;
}
} else {
ast_log(LOG_ERROR, "Memory Error!\n");