mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
bug 603592 - Swap endianness on GUIDs when de-stringifying them. r=mwu, a=blocking-fennec
--HG-- extra : rebase_source : fef5970b706e352cf442526f3a419a76696b5413
This commit is contained in:
parent
a71c6c9372
commit
7d484d4837
@ -264,6 +264,13 @@ void FileIDToGUID(const char* file_id, u_int8_t guid[sizeof(MDGUID)])
|
||||
guid[i] = (u_int8_t)(c & 0xFF);
|
||||
file_id += 2;
|
||||
}
|
||||
// GUIDs are stored in network byte order.
|
||||
uint32_t* data1 = reinterpret_cast<uint32_t*>(guid);
|
||||
*data1 = htonl(*data1);
|
||||
uint16_t* data2 = reinterpret_cast<uint16_t*>(guid + 4);
|
||||
*data2 = htons(*data2);
|
||||
uint16_t* data3 = reinterpret_cast<uint16_t*>(guid + 6);
|
||||
*data3 = htons(*data3);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user