# HG changeset patch # User Daniel Atallah # Date 1178655384 0 # Node ID 30b906ba39748114054af26f2cb158fd7aeba859 # Parent 74957a0aa633935a3db65d80d16c12d973892f4d Fix log viewer crash when the log filename is doesn't contain a date in the expected format. Fixes #588. diff -r 74957a0aa633 -r 30b906ba3974 libpurple/log.c --- a/libpurple/log.c Tue May 08 18:33:11 2007 +0000 +++ b/libpurple/log.c Tue May 08 20:16:24 2007 +0000 @@ -778,7 +778,7 @@ if (tz_off != PURPLE_NO_TZ_OFF) tm.tm_gmtoff = tz_off - tm.tm_gmtoff; - if (rest == NULL || (end = strchr(rest, '.')) == NULL || strchr(rest, ' ') != NULL) + if (stamp == 0 || rest == NULL || (end = strchr(rest, '.')) == NULL || strchr(rest, ' ') != NULL) { log = purple_log_new(type, name, account, NULL, stamp, NULL); } @@ -792,7 +792,7 @@ #else time_t stamp = purple_str_to_time(filename, FALSE, &tm, NULL, NULL); - log = purple_log_new(type, name, account, NULL, stamp, &tm); + log = purple_log_new(type, name, account, NULL, stamp, (stamp != 0) ? &tm : NULL); #endif log->logger = logger;