diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-15 00:24:24 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-15 00:24:24 +0000 |
commit | 4662d58b01e5493a39697027285bc22deb2f143c (patch) | |
tree | 6572dc8ac1336a5e0c0859186138a5313e88bd85 /apps/app_voicemail.c | |
parent | 124b00c4a4b971d8f4e34c3bbd73c992ad84d20c (diff) |
add API function for parsing strings to time_t (issue #6320, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index da3f90c0e..13ad2f786 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3608,25 +3608,21 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v int res = 0; struct vm_zone *the_zone = NULL; time_t t; - long tin; - if (sscanf(origtime,"%ld",&tin) < 1) { + if (ast_get_time_t(origtime, &t, 0)) { ast_log(LOG_WARNING, "Couldn't find origtime in %s\n", filename); return 0; } - t = tin; /* Does this user have a timezone specified? */ if (!ast_strlen_zero(vmu->zonetag)) { /* Find the zone in the list */ struct vm_zone *z; - z = zones; - while (z) { + for (z = zones; z; z = z->next) { if (!strcmp(z->name, vmu->zonetag)) { the_zone = z; break; } - z = z->next; } } |