swap first, then write.

This commit is contained in:
christos 2016-03-18 13:23:00 +00:00
parent bec9db1ba3
commit f15ed7b01a

View File

@ -173,12 +173,12 @@ write_objects(iidesc_t *idp, ctf_buf_t *b)
{
ushort_t id = (idp ? idp->ii_dtype->t_id : 0);
ctf_buf_write(b, &id, sizeof (id));
if (target_requires_swap) {
SWAP_16(id);
}
ctf_buf_write(b, &id, sizeof (id));
debug(3, "Wrote object %s (%d)\n", (idp ? idp->ii_name : "(null)"), id);
}