diff options
author | Rod Smith <rodsmith@rodsbooks.com> | 2021-06-08 15:23:02 -0400 |
---|---|---|
committer | Rod Smith <rodsmith@rodsbooks.com> | 2021-06-08 15:23:02 -0400 |
commit | 331ad9c795e4db7d09e8141979f809e4f5815319 (patch) | |
tree | f5175e41f8e0124fc10b9d190d5ea8d43bbe48ef /gptpart.cc | |
parent | 08be8933a9a55d4e919875bf4df4a3ed0a4b514e (diff) | |
download | sgdisk-331ad9c795e4db7d09e8141979f809e4f5815319.tar.gz |
Add ability to reverse byte order of partition names to gdisk and sgdisk
Diffstat (limited to 'gptpart.cc')
-rw-r--r-- | gptpart.cc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -412,14 +412,18 @@ int GPTPart::DoTheyOverlap(const GPTPart & other) { // Reverse the bytes of integral data types and of the UTF-16LE name; // used on big-endian systems. void GPTPart::ReversePartBytes(void) { - int i; - ReverseBytes(&firstLBA, 8); ReverseBytes(&lastLBA, 8); ReverseBytes(&attributes, 8); + ReverseNameBytes(); +} // GPTPart::ReversePartBytes() + +void GPTPart::ReverseNameBytes(void) { + int i; + for (i = 0; i < NAME_SIZE; i ++ ) ReverseBytes(name + i, 2); -} // GPTPart::ReversePartBytes() +} // GPTPart::ReverseNameBytes() /**************************************** * Functions requiring user interaction * |