# HG changeset patch # User Stu Tomlinson # Date 1195846904 0 # Node ID b2aa68cdc8b9c29f3b59d8f19e1951ac22a730ef # Parent 85fc97ffe5388adbabe36b425a818db22ea5357c I had used memcpy to copy the struct tm to where the caller wants it, but this assumes all callers provide their own allocated struct, which is not necessarily always the case. If callers want to keep the values of this struct tm across multiple calls to purple_str_to_time, they had better copy it themselves. (which is essentially the same as it was before when we were returning the pointer to the struct as returned by localtime(), which is also statically allocated) diff -r 85fc97ffe538 -r b2aa68cdc8b9 libpurple/util.c --- a/libpurple/util.c Thu Nov 22 19:34:50 2007 +0000 +++ b/libpurple/util.c Fri Nov 23 19:41:44 2007 +0000 @@ -897,7 +897,7 @@ if (tm != NULL) { - memcpy(tm, &t, sizeof(struct tm)); + *tm = t; tm->tm_isdst = -1; mktime(tm); }