libpurple/protocols/zephyr/ZParseNot.c

changeset 40653
503cfa50c8c3
parent 40643
1c9bdf8d3e85
--- a/libpurple/protocols/zephyr/ZParseNot.c	Thu Dec 17 23:50:15 2020 -0600
+++ b/libpurple/protocols/zephyr/ZParseNot.c	Fri Dec 18 01:38:49 2020 -0600
@@ -147,8 +147,8 @@
 	if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_uid,
 		       sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
 	    BAD_PACKET;
-	notice->z_time.tv_sec = ntohl((unsigned long) notice->z_uid.tv.tv_sec);
-	notice->z_time.tv_usec = ntohl((unsigned long) notice->z_uid.tv.tv_usec);
+	notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_sec);
+	notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_usec);
 	numfields--;
 	next_field (ptr);
     }
@@ -158,7 +158,7 @@
     if (numfields) {
 	if (ZReadAscii16(ptr, end-ptr, &notice->z_port) == ZERR_BADFIELD)
 	    BAD_PACKET;
-	notice->z_port = htons(notice->z_port);
+	notice->z_port = g_htons(notice->z_port);
 	numfields--;
 	next_field (ptr);
     }
@@ -261,8 +261,8 @@
 	if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_multiuid,
 		       sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
 	    BAD_PACKET;
-	notice->z_time.tv_sec = ntohl((unsigned long) notice->z_multiuid.tv.tv_sec);
-	notice->z_time.tv_usec = ntohl((unsigned long) notice->z_multiuid.tv.tv_usec);
+	notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_sec);
+	notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_usec);
 	numfields--;
 	next_field (ptr);
     }

mercurial