Mercurial > pidgin.yaz
diff libpurple/protocols/qq/packet_parse.c @ 18141:833f7cbe4f12
A patch from o_sukhodolsky to fix a compiler warning in the QQ code. I've
modified this patch so it actually compiles, then used the new function to
fix the other warning in the same file.
Fixes #1566
References #1344
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 17 Jun 2007 01:11:45 +0000 |
parents | 32c366eeeb99 |
children | 44b4e8bd759b |
line wrap: on
line diff
--- a/libpurple/protocols/qq/packet_parse.c Sun Jun 17 00:19:12 2007 +0000 +++ b/libpurple/protocols/qq/packet_parse.c Sun Jun 17 01:11:45 2007 +0000 @@ -65,6 +65,19 @@ } } +/* read four bytes as "time_t" from buf, + * return the number of bytes read if succeeds, otherwise return -1 + * This function is a wrapper around read_packet_dw() to avoid casting. */ +gint read_packet_time(guint8 *buf, guint8 **cursor, gint buflen, time_t *t) +{ + guint32 time; + gint ret = read_packet_dw(buf, cursor, buflen, &time); + if (ret != -1 ) { + *t = time; + } + return ret; +} + /* read datalen bytes from buf, * return the number of bytes read if succeeds, otherwise return -1 */ gint read_packet_data(guint8 *buf, guint8 **cursor, gint buflen, guint8 *data, gint datalen) {