diff libpurple/protocols/qq/packet_parse.c @ 24140:619ac2303c46

2009.10.02 - ccpaging <ccpaging(at)gmail.com> * Added 'Captcha Display' function * Most functions from patch written by Emil Alexiev merged into trunk, except 'buddy operations' * 'online buddy status' and 'qun buddies' still have problems
author SHiNE CsyFeK <csyfek@gmail.com>
date Wed, 22 Oct 2008 14:43:46 +0000
parents d57928c9dd8f
children c2253c485728
line wrap: on
line diff
--- a/libpurple/protocols/qq/packet_parse.c	Wed Oct 22 14:42:23 2008 +0000
+++ b/libpurple/protocols/qq/packet_parse.c	Wed Oct 22 14:43:46 2008 +0000
@@ -151,6 +151,9 @@
  * return the number of bytes packed, otherwise return -1 */
 gint qq_put32(guint8 *buf, guint32 dw)
 {
+	guint32 dw_dest;
+	memcpy(&dw_dest, buf, sizeof(dw_dest));
+
     guint32 dw_porter;
     dw_porter = g_htonl(dw);
 #ifdef PARSER_DEBUG
@@ -161,6 +164,19 @@
     return sizeof(dw_porter);
 }
 
+gint qq_putime(guint8 *buf, time_t *t)
+{
+	guint32 dw, dw_porter;
+	memcpy(&dw, t, sizeof(dw));
+    dw_porter = g_htonl(dw);
+#ifdef PARSER_DEBUG
+	purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf);
+	purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter);
+#endif
+    memcpy(buf, &dw_porter, sizeof(dw_porter));
+    return sizeof(dw_porter);
+}
+
 gint qq_putIP(guint8* buf, struct in_addr *ip)
 {
     memcpy(buf, ip, sizeof(struct in_addr));