commit - 6c41426143b93f57eebf1aaac35dcee4fa3fc282
commit + ac62b7128d19ff467525fe11e07efdbc47c53bb5
blob - 712b0f55c1bb511c3d3829528964d5036a503d9d
blob + ee37e1005b535f08ac796a6547d42f3394b34916
--- lib/pack.c
+++ lib/pack.c
goto done;
}
}
- if (be32toh(*h->magic) != GOT_PACKIDX_V2_MAGIC) {
+ if (*h->magic != htobe32(GOT_PACKIDX_V2_MAGIC)) {
err = got_error(GOT_ERR_BAD_PACKIDX);
goto done;
}
goto done;
}
}
- if (be32toh(*h->version) != GOT_PACKIDX_VERSION) {
+ if (*h->version != htobe32(GOT_PACKIDX_VERSION)) {
err = got_error(GOT_ERR_BAD_PACKIDX);
goto done;
}
/* Large file offsets are contained only in files > 2GB. */
for (i = 0; i < nobj; i++) {
- uint32_t o = be32toh(h->offsets[i]);
- if (o & GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX)
+ uint32_t o = h->offsets[i];
+ if (o & htobe32(GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX))
p->nlargeobj++;
}
if (p->nlargeobj == 0)