pidgin: 7f16ff52: purple_str_to_time() didn't necessarily ...

datallah at pidgin.im datallah at pidgin.im
Tue Aug 26 18:40:31 EDT 2008


-----------------------------------------------------------------
Revision: 7f16ff52262dcf6e66b6fd7796fca4bdd5de76bb
Ancestor: 8aa8fe5843cf6ada090ae743bf32984b6214aecb
Author: datallah at pidgin.im
Date: 2008-08-26T22:37:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7f16ff52262dcf6e66b6fd7796fca4bdd5de76bb

Modified files:
        libpurple/log.c libpurple/util.c

ChangeLog: 

purple_str_to_time() didn't necessarily set "rest" under all circumstances.
I'm pretty sure this fixes #4525.

-------------- next part --------------
============================================================
--- libpurple/log.c	fe5e338be0db19ca06501cec67aba3d3c1e44b4f
+++ libpurple/log.c	51e1f79dec75f867446670a4570874db9086fa6a
@@ -887,9 +887,8 @@ GList *purple_log_common_lister(PurpleLo
 			struct tm tm;
 #if defined (HAVE_TM_GMTOFF) && defined (HAVE_STRUCT_TM_TM_ZONE)
 			long tz_off;
-			const char *rest;
+			const char *rest, *end;
 			time_t stamp = purple_str_to_time(purple_unescape_filename(filename), FALSE, &tm, &tz_off, &rest);
-			char *end;
 
 			/* As zero is a valid offset, PURPLE_NO_TZ_OFF means no offset was
 			 * provided. See util.h. Yes, it's kinda ugly. */
============================================================
--- libpurple/util.c	d5bfc977156b3630b9296aa7732f9d652e20ba2c
+++ libpurple/util.c	643ccf2c5fb47d61cfdd57e5eeff34ccb023c7c7
@@ -768,6 +768,9 @@ purple_str_to_time(const char *timestamp
 	time(&retval);
 	localtime_r(&retval, &t);
 
+	if (rest != NULL)
+		*rest = NULL;
+
 	/* 4 digit year */
 	if (sscanf(c, "%04d", &year) && year > 1900)
 	{


More information about the Commits mailing list