diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-01 23:02:25 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-01 23:02:25 +0000 |
commit | 0c8cf106ef2b81fddbc9839476f0c666e86bae48 (patch) | |
tree | e5cb3c65a8b2815e66815465a16225d0a82458d6 /funcs | |
parent | e938c5abe7710472e1a350e34bf0e246749ff543 (diff) |
Add schedule extensions to app_meetme. In addition, the reporter found a
problem within strptime(3), which we are correcting here with ast_strptime().
(closes issue #11040)
Reported by: DEA
Patches:
20080910__bug11040.diff.txt uploaded by Corydon76 (license 14)
Tested by: DEA
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@145649 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index b8aac1351..b01cee9e6 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -691,10 +691,7 @@ static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data, AST_APP_ARG(timezone); AST_APP_ARG(format); ); - union { - struct ast_tm atm; - struct tm time; - } t = { { 0, }, }; + struct ast_tm tm; buf[0] = '\0'; @@ -712,13 +709,11 @@ static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data, return -1; } - if (!strptime(args.timestring, args.format, &t.time)) { - ast_log(LOG_WARNING, "C function strptime() output nothing?!!\n"); + if (!ast_strptime(args.timestring, args.format, &tm)) { + ast_log(LOG_WARNING, "STRPTIME() found no time specified within the string\n"); } else { struct timeval when; - /* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */ - t.atm.tm_isdst = -1; - when = ast_mktime(&t.atm, args.timezone); + when = ast_mktime(&tm, args.timezone); snprintf(buf, buflen, "%d", (int) when.tv_sec); } |