commit - 52a7447583292df7a622b4c0d4d462c55554739c
commit + 9eb6a6b2d1ab193449d90c240e14f2354b95a691
blob - ccd3f584d9191365c79b319787ea2189c0b21670
blob + 1dfa96ad74652b87753d1297b40b7282b1b33c6a
--- lib/fileindex.c
+++ lib/fileindex.c
return got_ferror(infile, GOT_ERR_IO);
SHA1Update(ctx, buf, sizeof(buf));
memcpy(val, buf, sizeof(*val));
- *val = htobe64(*val);
+ *val = be64toh(*val);
return NULL;
}
return got_ferror(infile, GOT_ERR_IO);
SHA1Update(ctx, buf, sizeof(buf));
memcpy(val, buf, sizeof(*val));
- *val = htobe32(*val);
+ *val = be32toh(*val);
return NULL;
}
return got_ferror(infile, GOT_ERR_IO);
SHA1Update(ctx, buf, sizeof(buf));
memcpy(val, buf, sizeof(*val));
- *val = htobe16(*val);
+ *val = be16toh(*val);
return NULL;
}
SHA1Update(&ctx, buf, len);
memcpy(&hdr, buf, len);
- hdr.signature = htobe32(hdr.signature);
- hdr.version = htobe32(hdr.version);
- hdr.nentries = htobe32(hdr.nentries);
+ hdr.signature = be32toh(hdr.signature);
+ hdr.version = be32toh(hdr.version);
+ hdr.nentries = be32toh(hdr.nentries);
if (hdr.signature != GOT_FILE_INDEX_SIGNATURE)
return got_error(GOT_ERR_FILEIDX_SIG);