summaryrefslogtreecommitdiff
path: root/funcs/func_strings.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-10-01 23:02:25 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-10-01 23:02:25 +0000
commit529874de7bf5ca57b2f6c662a9cb4cbfa28dbd74 (patch)
treee5cb3c65a8b2815e66815465a16225d0a82458d6 /funcs/func_strings.c
parent7eae109418777f15f5a3ddfaa6542d594d1874ad (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: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r--funcs/func_strings.c13
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);
}