diff src/protocols/icq/icqpacket.c @ 2474:19b4cd08e458

[gaim-migrate @ 2487] thanks Nathan Walp and Ben Miller committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 10 Oct 2001 19:58:11 +0000
parents 424a40f12a6c
children
line wrap: on
line diff
--- a/src/protocols/icq/icqpacket.c	Wed Oct 10 18:12:09 2001 +0000
+++ b/src/protocols/icq/icqpacket.c	Wed Oct 10 19:58:11 2001 +0000
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
 /*
- * $Id: icqpacket.c 2096 2001-07-31 01:00:39Z warmenhoven $
+ * $Id: icqpacket.c 2487 2001-10-10 19:58:11Z warmenhoven $
  *
  * Copyright (C) 1998-2001, Denis V. Dmitrienko <denis@null.net> and
  *                          Bill Soudan <soudan@kde.org>
@@ -59,7 +59,8 @@
 {
   DWORD val=i;
 
-  *(unsigned long*)((p->data)+(p->cursor))=htoicql(val);
+  val = htoicql(val);
+  memcpy((p->data)+(p->cursor),&val,sizeof(DWORD));
   icq_PacketAdvance(p, sizeof(DWORD));
 }
 
@@ -67,7 +68,7 @@
 {
   DWORD val=i;
 
-  *(DWORD *)((p->data)+(p->cursor)) = val;
+  memcpy((p->data)+(p->cursor),&val,sizeof(DWORD));
   icq_PacketAdvance(p, sizeof(DWORD));
 }
 
@@ -75,7 +76,8 @@
 {
   DWORD val;
 
-  val = icqtohl(*(DWORD *)((p->data)+(p->cursor)));
+  memcpy(&val,(p->data)+(p->cursor),sizeof(DWORD));
+  val = icqtohl(val);
   icq_PacketAdvance(p, sizeof(DWORD));
 
   return val;
@@ -85,7 +87,7 @@
 {
   DWORD val;
 
-  val = *(DWORD*)((p->data)+(p->cursor));
+  memcpy(&val,(p->data)+(p->cursor),sizeof(DWORD));
   icq_PacketAdvance(p, sizeof(DWORD));
 
   return val;
@@ -95,7 +97,8 @@
 {
   WORD val=i;
 
-  *(WORD *)((p->data)+(p->cursor)) = htoicqs(val);
+  val = htoicqs(val);
+  memcpy((p->data)+(p->cursor),&val,sizeof(WORD));
   icq_PacketAdvance(p, sizeof(WORD));
 }
 
@@ -103,7 +106,7 @@
 {
   WORD val=i;
 
-  *(WORD *)((p->data)+(p->cursor)) = val;
+  memcpy((p->data)+(p->cursor),&val,sizeof(WORD));
   icq_PacketAdvance(p, sizeof(WORD));
 }
 
@@ -111,7 +114,8 @@
 {
   WORD val;
 
-  val = icqtohs(*(WORD *)((p->data)+(p->cursor)));
+  memcpy(&val,(p->data)+(p->cursor),sizeof(WORD));
+  val = icqtohs(val);
   icq_PacketAdvance(p, sizeof(WORD));
 
   return val;
@@ -121,7 +125,7 @@
 {
   WORD val;
 
-  val = *(WORD*)((p->data)+(p->cursor));
+  memcpy(&val,(p->data)+(p->cursor),sizeof(WORD));
   icq_PacketAdvance(p, sizeof(WORD));
 
   return val;