From: <rl...@us...> - 2006-06-25 19:05:18
|
Revision: 16336 Author: rlaager Date: 2006-06-25 12:05:11 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16336&view=rev Log Message: ----------- Avoid calling gaim_utf8_strftime() multiple times. Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.c Modified: branches/soc-2006-file-loggers/src/log.c =================================================================== --- branches/soc-2006-file-loggers/src/log.c 2006-06-25 03:15:41 UTC (rev 16335) +++ branches/soc-2006-file-loggers/src/log.c 2006-06-25 19:05:11 UTC (rev 16336) @@ -1002,7 +1002,7 @@ const char *from, time_t time, const char *message) { char *msg_fixed; - const char *date = gaim_utf8_strftime("%F %T%z", localtime(&time)); + char *date = g_strdup(gaim_utf8_strftime("%F %T%z", localtime(&time))); GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); GaimLogCommonLoggerData *data = log->logger_data; @@ -1022,10 +1022,6 @@ // if file doesn't exist, die if (!data->file) return 0; - // because gaim_utf8_strftime returns a pointer to static data, - // and was called in gaim_log_common_writer - date = gaim_utf8_strftime("%F %T%z", localtime(&time)); - fprintf(data->file, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); if (log->type == GAIM_LOG_SYSTEM) @@ -1097,6 +1093,7 @@ } } + g_free(date); fflush(data->file); return written; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |