/pidgin/main: f93f8b0f36c3: Fix purple_str_to_time()'s tz_off si...

Mark Doliner mark at kingant.net
Tue Jan 21 02:48:41 EST 2014


FYI I think either this commit or 6a1aea2866aa is causing
test_util_str_to_time in libpurple/tests/test_util.c to fail.

The assertion in the test looks correct to me. The input is
2010-08-27.134202-0700PDT. It expects the timestamp to be 1282941722
but it's actually getting 1282891322, which is 14 hours off, which is
twice the time zone, which makes me think this commit is wrong.

I'm hoping to tag 2.10.8 in the private security repo tomorrow night.
I think it would be good to get to the bottom of this before then.
I'll try to look at it again tomorrow night if no one beats me to it.


On Mon, Jun 24, 2013 at 10:02 PM, Richard Laager <rlaager at pidgin.im> wrote:
> Changeset: f93f8b0f36c382a5b3b9b9d82c6cff4a4d87cf7b
> Author:  Richard Laager <rlaager at pidgin.im>
> Date:    2013-06-24 22:25 -0500
> Branch:  release-2.x.y
> URL: https://hg.pidgin.im/pidgin/main/rev/f93f8b0f36c3
>
> Description:
>
> Fix purple_str_to_time()'s tz_off sign handling
>
> This was introduced with the near-rewrite of this function in the
> patch from #13131 (hg commit 6a74f42c8c04).  It presumably went
> unnoticed this long because most (all default?) locales don't use
> the timezone offset when outputting dates.
>
> Refs #13131
> Fixes #15675
>
> diffstat:
>
>  libpurple/util.c |  2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diffs (12 lines):
>
> diff --git a/libpurple/util.c b/libpurple/util.c
> --- a/libpurple/util.c
> +++ b/libpurple/util.c
> @@ -807,7 +807,7 @@ purple_str_to_time(const char *timestamp
>                                 } while (*str >= '0' && *str <= '9');
>                         }
>
> -                       sign = (*str == '+') ? -1 : 1;
> +                       sign = (*str == '+') ? 1 : -1;
>
>                         /* Process the timezone */
>                         if (*str == '+' || *str == '-') {
>
> _______________________________________________
> Commits mailing list
> Commits at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/commits



More information about the Devel mailing list