From 529874de7bf5ca57b2f6c662a9cb4cbfa28dbd74 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 1 Oct 2008 23:02:25 +0000 Subject: 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: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- funcs/func_strings.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'funcs/func_strings.c') 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); } -- cgit v1.2.3