libpurple/protocols/zephyr/ZParseNot.c

changeset 40653
503cfa50c8c3
parent 40643
1c9bdf8d3e85
equal deleted inserted replaced
40652:0006f8158d6e 40653:503cfa50c8c3
145 145
146 if (numfields) { 146 if (numfields) {
147 if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_uid, 147 if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_uid,
148 sizeof(ZUnique_Id_t)) == ZERR_BADFIELD) 148 sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
149 BAD_PACKET; 149 BAD_PACKET;
150 notice->z_time.tv_sec = ntohl((unsigned long) notice->z_uid.tv.tv_sec); 150 notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_sec);
151 notice->z_time.tv_usec = ntohl((unsigned long) notice->z_uid.tv.tv_usec); 151 notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_usec);
152 numfields--; 152 numfields--;
153 next_field (ptr); 153 next_field (ptr);
154 } 154 }
155 else 155 else
156 BAD_PACKET; 156 BAD_PACKET;
157 157
158 if (numfields) { 158 if (numfields) {
159 if (ZReadAscii16(ptr, end-ptr, &notice->z_port) == ZERR_BADFIELD) 159 if (ZReadAscii16(ptr, end-ptr, &notice->z_port) == ZERR_BADFIELD)
160 BAD_PACKET; 160 BAD_PACKET;
161 notice->z_port = htons(notice->z_port); 161 notice->z_port = g_htons(notice->z_port);
162 numfields--; 162 numfields--;
163 next_field (ptr); 163 next_field (ptr);
164 } 164 }
165 else 165 else
166 BAD_PACKET; 166 BAD_PACKET;
259 259
260 if (numfields) { 260 if (numfields) {
261 if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_multiuid, 261 if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_multiuid,
262 sizeof(ZUnique_Id_t)) == ZERR_BADFIELD) 262 sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
263 BAD_PACKET; 263 BAD_PACKET;
264 notice->z_time.tv_sec = ntohl((unsigned long) notice->z_multiuid.tv.tv_sec); 264 notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_sec);
265 notice->z_time.tv_usec = ntohl((unsigned long) notice->z_multiuid.tv.tv_usec); 265 notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_usec);
266 numfields--; 266 numfields--;
267 next_field (ptr); 267 next_field (ptr);
268 } 268 }
269 else 269 else
270 notice->z_multiuid = notice->z_uid; 270 notice->z_multiuid = notice->z_uid;

mercurial