summaryrefslogtreecommitdiff
path: root/gptpart.cc
diff options
context:
space:
mode:
authorRod Smith <rodsmith@rodsbooks.com>2021-06-08 15:23:02 -0400
committerRod Smith <rodsmith@rodsbooks.com>2021-06-08 15:23:02 -0400
commit331ad9c795e4db7d09e8141979f809e4f5815319 (patch)
treef5175e41f8e0124fc10b9d190d5ea8d43bbe48ef /gptpart.cc
parent08be8933a9a55d4e919875bf4df4a3ed0a4b514e (diff)
downloadsgdisk-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.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gptpart.cc b/gptpart.cc
index 841140a..b83254d 100644
--- a/gptpart.cc
+++ b/gptpart.cc
@@ -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 *