If no timezone is available use the default message.

(closes issue #11576)
Reported by: junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 18 years ago
parent 6267956bda
commit 97b3e7ec72

@ -5269,10 +5269,10 @@ static struct unistim_device *build_device(const char *cat, const struct ast_var
if (ast_strlen_zero(d->maintext1)) if (ast_strlen_zero(d->maintext1))
strcpy(d->maintext1, d->name); strcpy(d->maintext1, d->name);
if (ast_strlen_zero(d->titledefault)) { if (ast_strlen_zero(d->titledefault)) {
struct ast_tm tm; struct ast_tm tm = { 0, };
struct timeval cur_time = ast_tvnow(); struct timeval cur_time = ast_tvnow();
if ((ast_localtime(&cur_time, &tm, 0)) == 0) { if ((ast_localtime(&cur_time, &tm, 0)) == 0 || ast_strlen_zero(tm.tm_zone)) {
display_last_error("Error in ast_localtime()"); display_last_error("Error in ast_localtime()");
ast_copy_string(d->titledefault, "UNISTIM for*", 12); ast_copy_string(d->titledefault, "UNISTIM for*", 12);
} else { } else {

Loading…
Cancel
Save